Mohammad Rezaei

Results 94 comments of Mohammad Rezaei

That works. A bit less "or-y": ```java int realLength = entries.length; while (realLength > 0 && entries[realLength - 1] == null) realLength--; ``` Then switch on realLength.

If we do this, are we then going to have endless enhancements to optimize the other methods on there? (It's unclear to me why sublist was overridden, for example).

confused... my copy of `AbstractMutableList` has this: ```java @Override public MutableList subList(int fromIndex, int toIndex) { return new SubList(this, fromIndex, toIndex); } ``` why is that not compiling?

That looks good to me, so long as there is a clear comment that says something to effect of "this is for scenarios where optimization is not a consideration and...

> Any suggestions to avoid creating an intermediate List that will be flattened into array? The only efficient way I can think of is to add a bunch of zeros...

None of the functions in any of the interfaces have been designed or tested for reentrancy. It's reasonable to expect reentrancy if the method is non-mutating, but for a mutating...

In a language like Rust, where the compiler enforces mutation semantics, the above code, where there is a mutable reference to the collection as well as a non-mutable reference, would...

There is some javadoc: https://www.eclipse.org/collections/javadoc/11.0.0/org/eclipse/collections/impl/map/mutable/ConcurrentHashMap.html More documentation is always welcome.

> I took a look at Python's `most_common` and it takes the front element from a heap k times, making it O(n * k). This is a nice compromise in...