Skip to content

Commit 9d5f234

Browse files
authored
Update MathBuilder.java
1 parent 1558d13 commit 9d5f234

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/com/thealgorithms/maths/MathBuilder.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,7 @@ public Builder recall(boolean cleanMemory) {
350350
public Builder recallIf(Function<Double, Boolean> condition, boolean cleanMemory) {
351351
if (!condition.apply(number)) return this;
352352
number = memory;
353-
if (cleanMemory)
354-
memory = 0;
353+
if (cleanMemory) memory = 0;
355354
return this;
356355
}
357356

@@ -365,8 +364,7 @@ public Builder set(double num) {
365364
// Replaces NUMBER with given number on condition
366365
public Builder setIf(double num, BiFunction<Double, Double, Boolean> condition) {
367366
if (number != 0) throw new RuntimeException("Number must be zero to set!");
368-
if (condition.apply(number, num))
369-
number = num;
367+
if (condition.apply(number, num)) number = num;
370368
return this;
371369
}
372370

0 commit comments

Comments
 (0)