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:
@@ -62,7 +62,7 @@ protected:
|
||||
};
|
||||
|
||||
List<Packet> _incoming_packets;
|
||||
Map<int, Ref<WebSocketPeer>> _peer_map;
|
||||
HashMap<int, Ref<WebSocketPeer>> _peer_map;
|
||||
Packet _current_packet;
|
||||
|
||||
bool _is_multiplayer = false;
|
||||
|
||||
@@ -113,7 +113,7 @@ bool WSLClient::_verify_headers(String &r_protocol) {
|
||||
ERR_FAIL_COND_V_MSG(req[0] != "HTTP/1.1", false, "Invalid protocol. Got: '" + req[0] + "', expected 'HTTP/1.1'.");
|
||||
ERR_FAIL_COND_V_MSG(req[1] != "101", false, "Invalid status code. Got: '" + req[1] + "', expected '101'.");
|
||||
|
||||
Map<String, String> headers;
|
||||
HashMap<String, String> headers;
|
||||
for (int i = 1; i < len; i++) {
|
||||
Vector<String> header = psa[i].split(":", false, 1);
|
||||
ERR_FAIL_COND_V_MSG(header.size() != 2, false, "Invalid header -> " + psa[i] + ".");
|
||||
|
||||
@@ -46,7 +46,7 @@ bool WSLServer::PendingPeer::_parse_request(const Vector<String> p_protocols, St
|
||||
ERR_FAIL_COND_V_MSG(req[0] != "GET" || req[2] != "HTTP/1.1", false, "Invalid method or HTTP version.");
|
||||
|
||||
r_resource_name = req[1];
|
||||
Map<String, String> headers;
|
||||
HashMap<String, String> headers;
|
||||
for (int i = 1; i < len; i++) {
|
||||
Vector<String> header = psa[i].split(":", false, 1);
|
||||
ERR_FAIL_COND_V_MSG(header.size() != 2, false, "Invalid header -> " + psa[i]);
|
||||
|
||||
Reference in New Issue
Block a user