Skip to content

Commit 9ebb247

Browse files
committed
removed marker from PAccumulate
1 parent 1e32f02 commit 9ebb247

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/ItertoolsModuleBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private PAccumulate create(VirtualFrame frame, Object cls, Object iterable, Obje
151151
PAccumulate self = factory().createAccumulate(cls);
152152
self.setIterable(getIter.execute(frame, iterable));
153153
self.setFunc(func instanceof PNone ? null : func);
154-
self.setTotal(PAccumulate.MARKER);
154+
self.setTotal(null);
155155
self.setInitial(initial instanceof PNone ? null : initial);
156156
return self;
157157
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/itertools/AccumulateBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Object next(VirtualFrame frame, PAccumulate self,
106106
return self.getTotal();
107107
}
108108
Object value = nextNode.execute(frame, self.getIterable(), PNone.NO_VALUE);
109-
if (self.getTotal() == PAccumulate.MARKER) {
109+
if (self.getTotal() == null) {
110110
markerProfile.enter();
111111
self.setTotal(value);
112112
return value;
@@ -161,7 +161,7 @@ Object reduce(VirtualFrame frame, PAccumulate self,
161161
Object func = self.getFunc() != null ? self.getFunc() : PNone.NONE;
162162
PTuple tuple = factory().createTuple(new Object[]{self.getIterable(), func});
163163

164-
Object total = self.getTotal() != PAccumulate.MARKER || self.getTotal() != null ? self.getTotal() : PNone.NONE;
164+
Object total = self.getTotal() != null ? self.getTotal() : PNone.NONE;
165165
return factory().createTuple(new Object[]{type, tuple, total});
166166
}
167167
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/itertools/PAccumulate.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545

4646
public final class PAccumulate extends PythonBuiltinObject {
4747

48-
public static final Object MARKER = new Object();
49-
5048
private Object iterable;
5149
private Object func;
5250
private Object total;
@@ -77,11 +75,6 @@ public Object getTotal() {
7775
}
7876

7977
public void setTotal(Object total) {
80-
// if(total == null) {
81-
// System.out.println("+++++++++++++++++++++++++++++++++++++++++++++");
82-
// new Exception().printStackTrace();
83-
// }
84-
// System.out.println("+++ SET TOTAL " + total);
8578
this.total = total;
8679
}
8780

0 commit comments

Comments
 (0)