Skip to content

Commit

Permalink
#1644 simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Jul 15, 2022
1 parent 6c6720d commit ddb681e
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/cactoos/io/HeadInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public int read() throws IOException {
if (this.processed >= this.length) {
adjusted = -1;
} else {
this.processed = this.processed + 1;
this.processed += 1;
adjusted = this.origin.read();
}
return adjusted;
Expand All @@ -82,7 +82,7 @@ public long skip(final long skip) throws IOException {
adjusted = skip;
}
final long skipped = this.origin.skip(adjusted);
this.processed = this.processed + skipped;
this.processed += skipped;
return skipped;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/number/AvgOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public AvgOf(final Iterable<? extends Number> src) {
BigDecimal total = BigDecimal.ZERO;
long qty = 0;
for (final Number value: new IterableOf<>(it)) {
qty = qty + 1;
qty += 1;
total = total.add(
new BigDecimal(value.toString())
);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/Randomized.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public Randomized(final Iterable<Character> itr, final Scalar<Integer> len, fina
final int length = len.value();
final StringBuilder builder = new StringBuilder(length);
final int bound = chrs.size();
for (int index = 0; index < length; index = index + 1) {
for (int index = 0; index < length; index += 1) {
builder.append(chrs.get(rnd.nextInt(bound)));
}
return builder.toString();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/TrimmedLeft.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public TrimmedLeft(final Text text) {
string.charAt(cursor)
)
) {
cursor = cursor + 1;
cursor += 1;
}
return string.substring(cursor);
},
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cactoos/text/TrimmedRight.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public TrimmedRight(final Text text) {
string -> {
int cursor = string.length() - 1;
while (cursor >= 0 && Character.isWhitespace(string.charAt(cursor))) {
cursor = cursor - 1;
cursor -= 1;
}
return string.substring(0, cursor + 1);
},
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/cactoos/func/SolidBiFuncTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void testThatFuncIsSynchronized() {
final BiFunc<Integer, Integer, Boolean> testable =
new SolidBiFunc<>(
(first, second) -> {
shared[0] = shared[0] + 1;
shared[0] += 1;
return true;
}
);
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/org/cactoos/scalar/RetryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ void runsScalarMultipleTimesWithWait() throws Exception {
Integer.MAX_VALUE,
Duration.ofMillis(wait)
).value();
for (int position = 0; position < executions.size() - 1; position =
position + 1) {
for (int position = 0; position < executions.size() - 1; position += 1) {
final int actual = position;
new Assertion<>(
"Should wait the given time between attempts",
Expand Down

4 comments on commit ddb681e

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on ddb681e Jul 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 1434-c8d2a46f disappeared from pom.xml), that's why I closed #1638. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on ddb681e Jul 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 1425-caaae80a disappeared from src/test/java/org/cactoos/package-info.java), that's why I closed #1639. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on ddb681e Jul 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 1335-074da419 disappeared from src/test/java/org/cactoos/number/SumOfTest.java), that's why I closed #1640. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on ddb681e Jul 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 1453-e619753d disappeared from pom.xml), that's why I closed #1642. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

Please sign in to comment.