Closed barakugav closed 1 year ago
Nice! Could you please add a unit test for both the primitive and the object version (e.g., adding it to IntArrayListTest and ObjectArrayListTest)?
It seems there are already few tests for it.
In IntArrayListTest: testRemoveIf testRemoveIf_jdkPredicate testRemoveIf_objectPredicate in ObjectArrayListTest: testRemoveIf
Just added a missing import, all seems to pass. Do you think there is a need for more?
Also, i see there is no CI for the repo. Did you consider setting up one? The JUnit tests could be run on each pull request automatically
I consider CI a gigantic waste or resources and electricity. We have an already big enough carbon footprint, I really don't want to run tests at each push...
@vigna As a small side note: IIRC, one can set up a manual CI so that you can with the push of a button run a CI script before you want to merge.
The current implementation of removeIf uses the iterator of the list, and iterator.remove(). This is very inefficient, as each remove() call may require a shift of all the following elements. The new implementation is similar to removeAll(), and runs in O(n) overall