You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +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) {
|
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;
|
type = p_variant.type;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user