You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +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:
@@ -210,7 +210,7 @@ Variant PackedDataContainer::_key_at_ofs(uint32_t p_ofs, const Variant &p_key, b
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpdata, Map<String, uint32_t> &string_cache) {
|
||||
uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpdata, HashMap<String, uint32_t> &string_cache) {
|
||||
switch (p_data.get_type()) {
|
||||
case Variant::STRING: {
|
||||
String s = p_data;
|
||||
@@ -321,7 +321,7 @@ uint32_t PackedDataContainer::_pack(const Variant &p_data, Vector<uint8_t> &tmpd
|
||||
|
||||
Error PackedDataContainer::pack(const Variant &p_data) {
|
||||
Vector<uint8_t> tmpdata;
|
||||
Map<String, uint32_t> string_cache;
|
||||
HashMap<String, uint32_t> string_cache;
|
||||
_pack(p_data, tmpdata, string_cache);
|
||||
datalen = tmpdata.size();
|
||||
data.resize(tmpdata.size());
|
||||
|
||||
Reference in New Issue
Block a user