Skip to content
Snippets Groups Projects
Commit 55fc122f authored by stepan's avatar stepan
Browse files

Avoid copying of temporary data when assigning to a list

parent 2979093d
No related branches found
No related tags found
No related merge requests found
......@@ -498,12 +498,14 @@ final class CachedReplaceVectorNode extends CachedVectorNode {
return returnVector;
}
private final ConditionProfile rightIsNotTemporary = ConditionProfile.createBinaryProfile();
private RTypedValue copyValueOnAssignment(RTypedValue value) {
if (value instanceof RShareable && value instanceof RAbstractVector) {
RShareable val = (RShareable) value;
if (rightIsShared.profile(val.isShared())) {
val = val.copy();
} else {
} else if (rightIsNotTemporary.profile(!val.isTemporary())) {
val.incRefCount();
}
return val;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment