You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
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:
@@ -31,9 +31,9 @@
|
||||
#ifndef GDSCRIPT_TOKENIZER_H
|
||||
#define GDSCRIPT_TOKENIZER_H
|
||||
|
||||
#include "core/templates/hash_map.h"
|
||||
#include "core/templates/list.h"
|
||||
#include "core/templates/map.h"
|
||||
#include "core/templates/set.h"
|
||||
#include "core/templates/rb_set.h"
|
||||
#include "core/templates/vector.h"
|
||||
#include "core/variant/variant.h"
|
||||
|
||||
@@ -193,7 +193,7 @@ public:
|
||||
new_line = p_new_line;
|
||||
}
|
||||
};
|
||||
const Map<int, CommentData> &get_comments() const {
|
||||
const HashMap<int, CommentData> &get_comments() const {
|
||||
return comments;
|
||||
}
|
||||
#endif // TOOLS_ENABLED
|
||||
@@ -226,7 +226,7 @@ private:
|
||||
int length = 0;
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
Map<int, CommentData> comments;
|
||||
HashMap<int, CommentData> comments;
|
||||
#endif // TOOLS_ENABLED
|
||||
|
||||
_FORCE_INLINE_ bool _is_at_end() { return position >= length; }
|
||||
|
||||
Reference in New Issue
Block a user