Skip to content

Commit c761ef1

Browse files
authored
Fixed call to Properties field when field optimization is disabled (#548)
1 parent d3fcd02 commit c761ef1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

source/UIDataCodeGen/CodeGen/InstantiatorGeneratorBase.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,14 +1296,6 @@ string CallFactoryFromFor_UnCached(ObjectData callerNode, ObjectData calleeNode)
12961296
return calleeNode.FieldName!;
12971297
}
12981298

1299-
if (_owner._disableFieldOptimization)
1300-
{
1301-
// When field optimization is disabled, always return a call to the factory.
1302-
// If the factory has been called already, it will return the value from
1303-
// its storage.
1304-
return calleeNode.FactoryCall();
1305-
}
1306-
13071299
if (calleeNode.Object is CompositionPropertySet propertySet)
13081300
{
13091301
// CompositionPropertySets do not have factories unless they are
@@ -1315,6 +1307,14 @@ string CallFactoryFromFor_UnCached(ObjectData callerNode, ObjectData calleeNode)
13151307
}
13161308
}
13171309

1310+
if (_owner._disableFieldOptimization)
1311+
{
1312+
// When field optimization is disabled, always return a call to the factory.
1313+
// If the factory has been called already, it will return the value from
1314+
// its storage.
1315+
return calleeNode.FactoryCall();
1316+
}
1317+
13181318
// Find the vertex from caller to callee.
13191319
var firstVertexFromCallerToCallee =
13201320
(from inref in calleeNode.InReferences

0 commit comments

Comments
 (0)