From f5785c65d64ee38960a98aa5eda4b665f46f21ad Mon Sep 17 00:00:00 2001
From: Adam Welc <adam.welc@oracle.com>
Date: Thu, 31 Dec 2015 11:12:49 -0800
Subject: [PATCH] Minor refactoring that reduces code duplication.

---
 .../com/oracle/truffle/r/runtime/data/RSequence.java  | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RSequence.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RSequence.java
index 3c407bdb43..0f9d84e562 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RSequence.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RSequence.java
@@ -157,16 +157,7 @@ public abstract class RSequence implements RAbstractVector {
 
     @Override
     public final RVector materializeNonShared() {
-        RVector resultVector = this.materialize();
-        assert !resultVector.isShared();
-        // marking non-temp must be consistent with what RVector does, otherwise the following code
-        // will not work:
-        // x<-1:3 ; attr(x, "myatt")<-2:4 ; y <- x; attr(x, "myatt1")<-"hello" ; attributes(y)
-        if (FastROptions.NewStateTransition.getBooleanValue()) {
-            resultVector.incRefCount();
-        } else {
-            resultVector.markNonTemporary();
-        }
+        RVector resultVector = this.materialize().materializeNonShared();
         return resultVector;
     }
 
-- 
GitLab