Started working on the next patch.
- Added: ISizeProvider interface (Optimization Helper) - Added: ISizeProvider into most Iterable implementations (Distinct/Filter/FlatMap/ArrayFlatMap don't support it, for obvious reasons) - Added: ToArray function into Iterable which uses ISizeProvider to reduce overhead of duplicating arrays. - Fixed: putIfAbsent now replaces defaultValues
This commit is contained in:
+4
-1
@@ -280,7 +280,10 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G
|
||||
int compare = 0;
|
||||
Node KEY_VALUE_GENERIC_TYPE parent = tree;
|
||||
while(true) {
|
||||
if((compare = compare(key, parent.key)) == 0) return parent.value;
|
||||
if((compare = compare(key, parent.key)) == 0) {
|
||||
if(VALUE_EQUALS(parent.value, getDefaultReturnValue())) return parent.setValue(value);
|
||||
return parent.value;
|
||||
}
|
||||
if(compare < 0) {
|
||||
if(parent.left == null) break;
|
||||
parent = parent.left;
|
||||
|
||||
Reference in New Issue
Block a user