Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
This commit is contained in:
@ -38,8 +38,8 @@
|
||||
#include "core/math/vector3.h"
|
||||
#include "core/object/ref_counted.h"
|
||||
#include "core/templates/list.h"
|
||||
#include "core/templates/map.h"
|
||||
#include "core/templates/oa_hash_map.h"
|
||||
#include "core/templates/rb_map.h"
|
||||
#include "core/templates/vector.h"
|
||||
#include "scene/resources/material.h"
|
||||
|
||||
@ -139,8 +139,8 @@ struct CSGBrushOperation {
|
||||
|
||||
Vector<Vector3> points;
|
||||
Vector<Face> faces;
|
||||
Map<Ref<Material>, int> materials;
|
||||
Map<Vector3, int> vertex_map;
|
||||
HashMap<Ref<Material>, int> materials;
|
||||
HashMap<Vector3, int> vertex_map;
|
||||
OAHashMap<VertexKey, int, VertexKeyHash> snap_cache;
|
||||
float vertex_snap = 0.0;
|
||||
|
||||
@ -184,8 +184,8 @@ struct CSGBrushOperation {
|
||||
};
|
||||
|
||||
struct Build2DFaceCollection {
|
||||
Map<int, Build2DFaces> build2DFacesA;
|
||||
Map<int, Build2DFaces> build2DFacesB;
|
||||
HashMap<int, Build2DFaces> build2DFacesA;
|
||||
HashMap<int, Build2DFaces> build2DFacesB;
|
||||
};
|
||||
|
||||
void update_faces(const CSGBrush &p_brush_a, const int p_face_idx_a, const CSGBrush &p_brush_b, const int p_face_idx_b, Build2DFaceCollection &p_collection, float p_vertex_snap);
|
||||
|
||||
Reference in New Issue
Block a user