You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user