We are now to 16k tests. Fixed loads of issues.
-Added: Tests for Lists and Sets. -Fixed: SubLists are now stable (they weren't before) -Fixed: All the bugs that the unit tests found so far. -Updated: ReadMe/Changelog
This commit is contained in:
@@ -213,6 +213,9 @@ public class AVL_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
|
||||
#endif
|
||||
@Override
|
||||
public boolean add(KEY_TYPE o) {
|
||||
#if TYPE_OBJECT
|
||||
validate(o);
|
||||
#endif
|
||||
if(tree == null) {
|
||||
tree = first = last = new EntryBRACES(o, null);
|
||||
size++;
|
||||
@@ -242,7 +245,7 @@ public class AVL_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
|
||||
}
|
||||
fixAfterInsertion(adding);
|
||||
size++;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -652,6 +655,7 @@ public class AVL_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE
|
||||
}
|
||||
}
|
||||
|
||||
protected void validate(KEY_TYPE k) { compare(k, k); }
|
||||
protected int compare(KEY_TYPE k, KEY_TYPE v) { return comparator != null ? comparator.compare(k, v) : COMPAREABLE_TO_KEY(k, v);}
|
||||
|
||||
/** From CLR */
|
||||
|
||||
Reference in New Issue
Block a user