pop() was not implemented correctly

This commit is contained in:
Ben Fry
2015-04-27 16:50:20 -04:00
parent 151d7f3998
commit 85467e7d81
2 changed files with 4 additions and 4 deletions
+2 -3
View File
@@ -150,9 +150,8 @@ public class StringList implements Iterable<String> {
if (count == 0) {
throw new RuntimeException("Can't call pop() on an empty list");
}
count--; // back up to the last entry
String value = get(count);
data[count] = null; // avoid leak
String value = get(count-1);
data[--count] = null; // avoid leak
return value;
}
+2 -1
View File
@@ -1,4 +1,5 @@
0235 (3.0a7)
0235 (3.0a8)
X pop() was not implemented correctly
high priority