Skip to content

Commit

Permalink
Resolve #1940: Refactor ThenKeyExpression#normalizeKeyForPositions fo…
Browse files Browse the repository at this point in the history
…r performance (#1941)
  • Loading branch information
ohadzeliger committed Dec 12, 2022
1 parent d7a2687 commit b2bc403
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/ReleaseNotes.md
Expand Up @@ -15,7 +15,7 @@ The Guava dependency version has been updated to 31.1. Projects may need to chec
// begin next release
### NEXT_RELEASE
* **Bug fix** Fix 1 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Refactor ThenKeyExpression#normalizeKeyForPositions to reduce hotspot detected by removing stream() implementation to reduce new object creation [(Issue #1940)](https://github.com/FoundationDB/fdb-record-layer/issues/1940)
* **Bug fix** Fix 2 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Fix 3 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Fix 4 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
Expand Down
Expand Up @@ -194,9 +194,11 @@ public <S extends KeyExpressionVisitor.State, R> R expand(@Nonnull final KeyExpr
@Nonnull
@Override
public List<KeyExpression> normalizeKeyForPositions() {
return getChildren()
.stream().flatMap(k -> k.normalizeKeyForPositions().stream())
.collect(Collectors.toList());
List<KeyExpression> list = new ArrayList<>();
for (KeyExpression k : getChildren()) {
list.addAll(k.normalizeKeyForPositions());
}
return list;
}

@Override
Expand Down

0 comments on commit b2bc403

Please sign in to comment.