Merge pull request #115093 from Ivorforce/hashmap-explicit-copy

Change copy constructors of `HashMap` and `AHashMap` from implicit to explicit
This commit is contained in:
Rémi Verschelde 2026-01-31 22:50:51 +01:00
commit 429750f60b
No known key found for this signature in database
GPG key ID: C3336907360768E1
30 changed files with 34 additions and 35 deletions

View file

@ -1640,7 +1640,7 @@ void ProjectSettings::_bind_methods() {
void ProjectSettings::_add_builtin_input_map() {
if (InputMap::get_singleton()) {
HashMap<String, List<Ref<InputEvent>>> builtins = InputMap::get_singleton()->get_builtins();
HashMap<String, List<Ref<InputEvent>>> builtins(InputMap::get_singleton()->get_builtins());
for (KeyValue<String, List<Ref<InputEvent>>> &E : builtins) {
Array events;

View file

@ -900,7 +900,7 @@ const HashMap<String, List<Ref<InputEvent>>> &InputMap::get_builtins_with_featur
}
void InputMap::load_default() {
HashMap<String, List<Ref<InputEvent>>> builtins = get_builtins_with_feature_overrides_applied();
HashMap<String, List<Ref<InputEvent>>> builtins(get_builtins_with_feature_overrides_applied());
for (const KeyValue<String, List<Ref<InputEvent>>> &E : builtins) {
String name = E.key;

View file

@ -673,7 +673,7 @@ public:
p_other._size = 0;
}
AHashMap(const AHashMap &p_other) {
explicit AHashMap(const AHashMap &p_other) {
_init_from(p_other);
}

View file

@ -582,7 +582,7 @@ public:
/* Constructors */
HashMap(const HashMap &p_other) {
explicit HashMap(const HashMap &p_other) {
reserve(hash_table_size_primes[p_other._capacity_idx]);
if (p_other._size == 0) {