[ci skip] Add more identifying patch comments

This commit is contained in:
Nassim Jahnke
2024-01-21 12:11:43 +01:00
parent dee90322eb
commit f6609428b6
46 changed files with 136 additions and 140 deletions

View File

@@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private static final class Left<L, R> extends Either<L, R> {
- private final L value;
+ private final L value; private Optional<L> valueOptional; // Paper - reduce the optional allocation...
+ private final L value; private Optional<L> valueOptional; // Paper - Perf: Reduce Either Optional allocation
public Left(final L value) {
this.value = value;
@@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public Optional<L> left() {
- return Optional.of(value);
+ return this.valueOptional == null ? this.valueOptional = Optional.of(this.value) : this.valueOptional; // Paper - reduce the optional allocation...
+ return this.valueOptional == null ? this.valueOptional = Optional.of(this.value) : this.valueOptional; // Paper - Perf: Reduce Either Optional allocation
}
@Override
@@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private static final class Right<L, R> extends Either<L, R> {
- private final R value;
+ private final R value; private Optional<R> valueOptional; // Paper - reduce the optional allocation...
+ private final R value; private Optional<R> valueOptional; // Paper - Perf: Reduce Either Optional allocation
public Right(final R value) {
this.value = value;
@@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public Optional<R> right() {
- return Optional.of(value);
+ return this.valueOptional == null ? this.valueOptional = Optional.of(this.value) : this.valueOptional; // Paper - reduce the optional allocation...
+ return this.valueOptional == null ? this.valueOptional = Optional.of(this.value) : this.valueOptional; // Paper - Perf: Reduce Either Optional allocation
}
@Override