Remove VariantHasher and VariantComparator in favour of specializing HashMapHasherDefault and HashMapComparatorDefault.
This commit is contained in:
@ -82,15 +82,6 @@ private:
|
||||
|
||||
Ref<ArrayMesh> root_mesh;
|
||||
|
||||
struct Vector3Hasher {
|
||||
_ALWAYS_INLINE_ uint32_t hash(const Vector3 &p_vec3) const {
|
||||
uint32_t h = hash_murmur3_one_float(p_vec3.x);
|
||||
h = hash_murmur3_one_float(p_vec3.y, h);
|
||||
h = hash_murmur3_one_float(p_vec3.z, h);
|
||||
return h;
|
||||
}
|
||||
};
|
||||
|
||||
struct ShapeUpdateSurface {
|
||||
Vector<Vector3> vertices;
|
||||
Vector<Vector3> normals;
|
||||
|
||||
@ -3833,7 +3833,7 @@ void GDScriptAnalyzer::reduce_cast(GDScriptParser::CastNode *p_cast) {
|
||||
}
|
||||
|
||||
void GDScriptAnalyzer::reduce_dictionary(GDScriptParser::DictionaryNode *p_dictionary) {
|
||||
HashMap<Variant, GDScriptParser::ExpressionNode *, VariantHasher, StringLikeVariantComparator> elements;
|
||||
HashMap<Variant, GDScriptParser::ExpressionNode *, HashMapHasherDefault, StringLikeVariantComparator> elements;
|
||||
|
||||
for (int i = 0; i < p_dictionary->elements.size(); i++) {
|
||||
const GDScriptParser::DictionaryNode::Pair &element = p_dictionary->elements[i];
|
||||
|
||||
@ -104,7 +104,7 @@ class GDScriptByteCodeGenerator : public GDScriptCodeGenerator {
|
||||
List<int> temp_stack;
|
||||
#endif
|
||||
|
||||
HashMap<Variant, int, VariantHasher, VariantComparator> constant_map;
|
||||
HashMap<Variant, int> constant_map;
|
||||
RBMap<StringName, int> name_map;
|
||||
#ifdef TOOLS_ENABLED
|
||||
Vector<StringName> named_globals;
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
#include "core/io/compression.h"
|
||||
#include "core/io/marshalls.h"
|
||||
|
||||
int GDScriptTokenizerBuffer::_token_to_binary(const Token &p_token, Vector<uint8_t> &r_buffer, int p_start, HashMap<StringName, uint32_t> &r_identifiers_map, HashMap<Variant, uint32_t, VariantHasher, VariantComparator> &r_constants_map) {
|
||||
int GDScriptTokenizerBuffer::_token_to_binary(const Token &p_token, Vector<uint8_t> &r_buffer, int p_start, HashMap<StringName, uint32_t> &r_identifiers_map, HashMap<Variant, uint32_t> &r_constants_map) {
|
||||
int pos = p_start;
|
||||
|
||||
int token_type = p_token.type & TOKEN_MASK;
|
||||
@ -239,7 +239,7 @@ Error GDScriptTokenizerBuffer::set_code_buffer(const Vector<uint8_t> &p_buffer)
|
||||
|
||||
Vector<uint8_t> GDScriptTokenizerBuffer::parse_code_string(const String &p_code, CompressMode p_compress_mode) {
|
||||
HashMap<StringName, uint32_t> identifier_map;
|
||||
HashMap<Variant, uint32_t, VariantHasher, VariantComparator> constant_map;
|
||||
HashMap<Variant, uint32_t> constant_map;
|
||||
Vector<uint8_t> token_buffer;
|
||||
HashMap<uint32_t, uint32_t> token_lines;
|
||||
HashMap<uint32_t, uint32_t> token_columns;
|
||||
|
||||
@ -63,7 +63,7 @@ public:
|
||||
HashMap<int, CommentData> dummy;
|
||||
#endif // TOOLS_ENABLED
|
||||
|
||||
static int _token_to_binary(const Token &p_token, Vector<uint8_t> &r_buffer, int p_start, HashMap<StringName, uint32_t> &r_identifiers_map, HashMap<Variant, uint32_t, VariantHasher, VariantComparator> &r_constants_map);
|
||||
static int _token_to_binary(const Token &p_token, Vector<uint8_t> &r_buffer, int p_start, HashMap<StringName, uint32_t> &r_identifiers_map, HashMap<Variant, uint32_t> &r_constants_map);
|
||||
Token _binary_to_token(const uint8_t *p_buffer);
|
||||
|
||||
public:
|
||||
|
||||
@ -525,7 +525,7 @@ class TextServerAdvanced : public TextServerExtension {
|
||||
Rect2 rect;
|
||||
double baseline = 0;
|
||||
};
|
||||
HashMap<Variant, EmbeddedObject, VariantHasher, VariantComparator> objects;
|
||||
HashMap<Variant, EmbeddedObject> objects;
|
||||
|
||||
/* Shaped data */
|
||||
TextServer::Direction para_direction = DIRECTION_LTR; // Detected text direction.
|
||||
|
||||
@ -458,7 +458,7 @@ class TextServerFallback : public TextServerExtension {
|
||||
Rect2 rect;
|
||||
double baseline = 0;
|
||||
};
|
||||
HashMap<Variant, EmbeddedObject, VariantHasher, VariantComparator> objects;
|
||||
HashMap<Variant, EmbeddedObject> objects;
|
||||
|
||||
/* Shaped data */
|
||||
TextServer::Direction para_direction = DIRECTION_LTR; // Detected text direction.
|
||||
|
||||
Reference in New Issue
Block a user