Code refactor for AbsoluteMin improvements (#3031)
Fix #3030 Co-authored-by: Yang Libin <szuyanglb@outlook.com>
This commit is contained in:
parent
c8b0a201da
commit
1320748c88
@ -21,11 +21,8 @@ public class AbsoluteMin {
|
||||
|
||||
Arrays.stream(numbers)
|
||||
.skip(1)
|
||||
.forEach(number -> {
|
||||
if (Math.abs(number) < Math.abs(absMinWrapper.value)) {
|
||||
absMinWrapper.value = number;
|
||||
}
|
||||
});
|
||||
.filter(number -> Math.abs(number) < Math.abs(absMinWrapper.value))
|
||||
.forEach(number -> absMinWrapper.value = number);
|
||||
|
||||
return absMinWrapper.value;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user