Closed Masynchin closed 6 months ago
does this not reverse the list? I suppose a new test would be nice here
does this not reverse the list? I suppose a new test would be nice here
Nope, I just reimplemented filter
which propagates predicate only once. Here is the quick scastie demo:
does this not reverse the list? I suppose a new test would be nice here
We already have tests, but not for preserving order. I did add those tests.
Also the name of this function is misleading, it actually only removes the first item that have the correspondent id. Added a test and comments to clarify it as well.
I hope this code works the same as previous one, and improves performance.
I believe I wrote the code that way to avoid recursion, but your solution can be recursiveless as well with tailrec
annotation. So, the performance should be at least the same (maybe an actual benchmark will tell different story). And this is indeed looks better than before.
I failed to run tests and scared to run benchmarks, so I will rely on CI.
What is your problem? I'd like to help you with your local setup if you want. And thanks for pr!
What is your problem? I'd like to help you with your local setup if you want. And thanks for pr!
@lenguyenthanh sorry for the delay, but I would be thankful if you help me. I was trying to run sbt testKit / test
, but it failed:
Then I have tried sbt testKit/test
, but it also failed:
[error] 21 is not a valid choice for -java-output-version
This is the problem, You need to use jdk 21 to compile/run/test
This is the problem, You need to use jdk 21 to compile/run/test
Thanks for the help! I'll upgrade it
I failed to run tests and scared to run benchmarks, so I will rely on CI. I hope this code works the same as previous one, and improves performance.