diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-09-23 11:36:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-23 11:36:40 +0200 |
commit | 46f909f8af092cf1aa9f708a174af6c57b32430d (patch) | |
tree | e488b501a303057e1b3a590cd79c1b43808b8c0b /core | |
parent | fb12f54721ad4b6ab3755624ea912de3af8c12b3 (diff) | |
parent | 6a36779e89c3183b6ef58e250bcd10735736d4d8 (diff) |
Merge pull request #32054 from puthre/variant_ref_optim
Optimized variant reference function.
Diffstat (limited to 'core')
-rw-r--r-- | core/variant.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/variant.cpp b/core/variant.cpp index e7d0e58367..16bbf94c54 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -910,7 +910,15 @@ bool Variant::is_one() const { void Variant::reference(const Variant &p_variant) { - clear(); + switch (type) { + case NIL: + case BOOL: + case INT: + case REAL: + break; + default: + clear(); + } type = p_variant.type; |