Skip to content
Browse files

Fixes for #28 and #24

  • Loading branch information...
1 parent 2611a76 commit c167db4adfa976d32acb6d936655479a68db6190 @FroMage FroMage committed Jul 27, 2012
View
3 collection/source/ceylon/collection/HashMap.ceylon
@@ -64,7 +64,7 @@ shared class HashMap<Key, Item>()
shared actual void remove(Key key){
Integer index = storeIndex(key, store);
variable Cell<Key->Item>? bucket := store[index];
- variable Cell<Key->Item>? prev := bucket;
+ variable Cell<Key->Item>? prev := null;
while(exists Cell<Key->Item> cell = bucket){
if(cell.car.key == key){
// found it
@@ -76,6 +76,7 @@ shared class HashMap<Key, Item>()
_size--;
return;
}
+ prev := cell;
bucket := cell.cdr;
}
}
View
3 collection/source/ceylon/collection/HashSet.ceylon
@@ -64,7 +64,7 @@ shared class HashSet<Element>()
shared actual void remove(Element element){
Integer index = storeIndex(element, store);
variable Cell<Element>? bucket := store[index];
- variable Cell<Element>? prev := bucket;
+ variable Cell<Element>? prev := null;
while(exists Cell<Element> cell = bucket){
if(cell.car == element){
// found it
@@ -76,6 +76,7 @@ shared class HashSet<Element>()
_size--;
return;
}
+ prev := cell;
bucket := cell.cdr;
}
}

0 comments on commit c167db4

Please sign in to comment.
Something went wrong with that request. Please try again.