Skip to content

Commit

Permalink
Fix #31
Browse files Browse the repository at this point in the history
  • Loading branch information
polygonal committed Mar 16, 2016
1 parent bb00b7b commit 92f611b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/de/polygonal/ds/ArrayList.hx
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,7 @@ class ArrayList<T> implements List<T>
var d = mData;
var x = d.get(i);
#if (neko || java || cs || cpp)
d.blit(i + 1, d, i, size - i);
--mSize;
d.blit(i + 1, d, i, --mSize - i);
#else
var k = --mSize;
var p = i;
Expand Down
11 changes: 11 additions & 0 deletions test/TestArrayList.hx
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,17 @@ class TestArrayList extends AbstractTest
a.add(1);
a.removeAt(0);
assertEquals(0, a.size);

a.pushBack(1);
a.pushBack(2);
assertEquals(2, a.removeAt(1));
assertEquals(1, a.size);

var len = a.capacity;
a = new ArrayList<Int>();
for (i in 0...len) a.pushBack(i);
assertEquals(len - 1, a.removeAt(a.size - 1));
assertEquals(len - 1, a.size);
}

function testJoin()
Expand Down

0 comments on commit 92f611b

Please sign in to comment.