From 85467e7d81c37d064aa26945aaf09dd4e048295f Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Mon, 27 Apr 2015 16:50:20 -0400 Subject: [PATCH] pop() was not implemented correctly --- core/src/processing/data/StringList.java | 5 ++--- core/todo.txt | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/processing/data/StringList.java b/core/src/processing/data/StringList.java index 3507545b6..561db6ab0 100644 --- a/core/src/processing/data/StringList.java +++ b/core/src/processing/data/StringList.java @@ -150,9 +150,8 @@ public class StringList implements Iterable { 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; } diff --git a/core/todo.txt b/core/todo.txt index 40b785520..041dcb316 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -1,4 +1,5 @@ -0235 (3.0a7) +0235 (3.0a8) +X pop() was not implemented correctly high priority