Make SortedTree immutable for now.
This commit is contained in:
1 parent
d2a2de0a4d
commit
02cc555cc0
1 file changed
+2
-2
@@ -27,7 +27,7 @@ namespace bts.collections {
|
||||
|
||||
// Insert (return: true) or overwrite (return false) a new value
|
||||
// NOTE: you should use AddAll if you are adding multiple values
|
||||
public bool Insert(T item) {
|
||||
bool Insert(T item) {
|
||||
var item_id = id(item);
|
||||
if (!_index.TryGetValue(item_id, out Node itemnode)) {
|
||||
// Item is new
|
||||
@@ -57,7 +57,7 @@ namespace bts.collections {
|
||||
}
|
||||
}
|
||||
}
|
||||
public void Remove(T item) {
|
||||
void Remove(T item) {
|
||||
var item_id = id(item);
|
||||
if (_index.TryGetValue(item_id, out Node itemnode)) {
|
||||
if (_index.TryGetValue(parent(item), out Node parentnode)) {
|
||||
|
||||
Reference in new issue
Block a user