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)
|
Arrays.stream(numbers)
|
||||||
.skip(1)
|
.skip(1)
|
||||||
.forEach(number -> {
|
.filter(number -> Math.abs(number) < Math.abs(absMinWrapper.value))
|
||||||
if (Math.abs(number) < Math.abs(absMinWrapper.value)) {
|
.forEach(number -> absMinWrapper.value = number);
|
||||||
absMinWrapper.value = number;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return absMinWrapper.value;
|
return absMinWrapper.value;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user