Optimized variant reference function.
Optimized critical execution path in Variant::reference by removing expensive and unnecessary call to clear for atomic types.
This commit is contained in:
parent
24e1039eb6
commit
6a36779e89
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue