Skip to content

Commit 968c6b7

Browse files
committed
Remove unnecessary parentheses
1 parent 35fb706 commit 968c6b7

File tree

15 files changed

+29
-29
lines changed

15 files changed

+29
-29
lines changed

algo-common/src/main/java/org/neo4j/gds/Converters.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ static RelationshipConsumer longToIntConsumer(IntBinaryPredicate p) {
3939
}
4040

4141
static RelationshipWithPropertyConsumer longToIntConsumer(IntIntDoublePredicate p) {
42-
return ((sourceNodeId, targetNodeId, property) -> {
42+
return (sourceNodeId, targetNodeId, property) -> {
4343
int s = Math.toIntExact(sourceNodeId);
4444
int t = Math.toIntExact(targetNodeId);
4545
return p.test(s, t, property);
46-
});
46+
};
4747
}
4848

4949
@FunctionalInterface

algo/src/main/java/org/neo4j/gds/bridges/Bridges.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public BridgeResult compute() {
7373
//each edge may have at most one event to the stack at the same time
7474
var stack = HugeObjectArray.newArray(StackEvent.class, graph.relationshipCount());
7575

76-
BiConsumer<Long,Long> onLastChildVisit = (treeSizeTracker.isPresent()) ? treeSizeTracker.get()::recordTreeChild : (a,b)->{};
76+
BiConsumer<Long,Long> onLastChildVisit = treeSizeTracker.isPresent() ? treeSizeTracker.get()::recordTreeChild : (a,b)->{};
7777
int listIndex=0;
7878
var n = graph.nodeCount();
7979
for (long i = 0; i < n; ++i) {

algo/src/main/java/org/neo4j/gds/bridges/BridgesMemoryEstimateDefinition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ public MemoryEstimation memoryEstimation() {
5252
.perNode("treeSize", HugeLongArray::memoryEstimation)
5353
.build());
5454
}
55-
builder.rangePerGraphDimension("stack", ((graphDimensions, concurrency) -> {
55+
builder.rangePerGraphDimension("stack", (graphDimensions, concurrency) -> {
5656
long relationshipCount = graphDimensions.relCountUpperBound();
5757
return MemoryRange.of(
5858
HugeObjectArray.memoryEstimation(relationshipCount, Estimate.sizeOfInstance(Bridges.StackEvent.class))
5959
);
6060

6161

62-
}));
62+
});
6363

6464
return builder.build();
6565
}

algo/src/main/java/org/neo4j/gds/cliqueCounting/CliqueCountingMemoryEstimateDefinition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ public MemoryEstimation memoryEstimation() {
4242

4343
private MemoryEstimation thread(){
4444
return MemoryEstimations.builder()
45-
.rangePerGraphDimension("Intersections",((graphDimensions, concurrency) -> {
45+
.rangePerGraphDimension("Intersections", (graphDimensions, concurrency) -> {
4646
var bound1 = (long)(graphDimensions.averageDegree()*2.7);
4747
var bound2 = (long) (0.48*Math.sqrt(graphDimensions.relCountUpperBound())); //a theoretical bound ¯\_(ツ)_/¯
4848
var cost1 = cost(bound1);
4949
var cost2 = cost(bound2);
5050
return MemoryRange.of(Math.min(cost1, cost2), Math.max(cost1, cost2));
51-
}))
51+
})
5252
.build();
5353

5454
}

algo/src/main/java/org/neo4j/gds/indexInverse/InverseRelationshipsMemoryEstimateDefinition.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ public MemoryEstimation memoryEstimation() {
5050
AdjacencyListBehavior.adjacencyListsFromStarEstimation(false)
5151
);
5252

53-
builderForType.perGraphDimension("All properties", ((graphDimensions, concurrency) -> {
53+
builderForType.perGraphDimension("All properties", (graphDimensions, concurrency) -> {
5454
var singlePropertyEstimation = AdjacencyListBehavior
5555
.adjacencyPropertiesFromStarEstimation( false)
5656
.estimate(graphDimensions, concurrency)
5757
.memoryUsage();
5858

5959
return singlePropertyEstimation.times(graphDimensions.relationshipPropertyTokens().size());
60-
}));
60+
});
6161

6262
builder.add(String.format(Locale.US, "Inverse '%s'", typeName), builderForType.build());
6363
} else {
@@ -69,14 +69,14 @@ public MemoryEstimation memoryEstimation() {
6969
);
7070

7171

72-
builderForType.perGraphDimension("properties", ((graphDimensions, concurrency) -> {
72+
builderForType.perGraphDimension("properties", (graphDimensions, concurrency) -> {
7373
var singlePropertyEstimation = AdjacencyListBehavior
7474
.adjacencyPropertiesEstimation(relationshipType, false)
7575
.estimate(graphDimensions, concurrency)
7676
.memoryUsage();
7777

7878
return singlePropertyEstimation.times(graphDimensions.relationshipPropertyTokens().size());
79-
}));
79+
});
8080

8181
builder.add(String.format(Locale.US, "Inverse '%s'", typeName), builderForType.build());
8282
}

algo/src/main/java/org/neo4j/gds/kcore/KCoreDecompositionMemoryEstimateDefinition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public MemoryEstimation memoryEstimation() {
3636
.perNode("cores", HugeIntArray::memoryEstimation)
3737
.perThread("KCoreDecompositionTask", KCoreDecompositionTask.memoryEstimation());
3838

39-
builder.perGraphDimension("RebuildTask", ((graphDimensions, concurrency) -> {
39+
builder.perGraphDimension("RebuildTask", (graphDimensions, concurrency) -> {
4040
var resizedNodeCount = Math.max(
4141
1,
4242
(long) Math.ceil(graphDimensions.nodeCount() * KCoreDecomposition.REBUILD_CONSTANT)
@@ -46,7 +46,7 @@ public MemoryEstimation memoryEstimation() {
4646
var rebuildArray = HugeIntArray.memoryEstimation(resizedNodeCount);
4747
return MemoryRange.of(totalRebuildTasks + rebuildArray);
4848

49-
}));
49+
});
5050

5151
return builder.build();
5252
}

algo/src/main/java/org/neo4j/gds/pricesteiner/PrizeSteinerTreeMemoryEstimateDefinition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ private MemoryEstimation growthSpecificMemory(){
5656
.add("cluster structure", clusterStructureSpecificMemory())
5757
.add("edge queue", edgeQueueSpecificMemory())
5858
.add("cluster queue", clusterQueueSpecificMemory())
59-
.rangePerGraphDimension("edge save", ((graphDimensions, concurrency) -> {
59+
.rangePerGraphDimension("edge save", (graphDimensions, concurrency) -> {
6060
long edges = graphDimensions.relCountUpperBound();
6161
var edgePartsSize = HugeLongArray.memoryEstimation(edges);
6262
var edgeWeightsSize= HugeDoubleArray.memoryEstimation(edges/2);
6363
return MemoryRange.of(edgePartsSize +edgeWeightsSize);
64-
}))
64+
})
6565
.perNode("tree edges", HugeLongArray::memoryEstimation)
6666
.build();
6767
}

algo/src/main/java/org/neo4j/gds/pricesteiner/StrongPruning.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void performPruning(){
117117
}
118118
var actualParentCost = parentCost.getValue();
119119

120-
if (Double.compare(actualParentCost, (dp.get(nextLeaf))) < 0) {
120+
if (Double.compare(actualParentCost, dp.get(nextLeaf)) < 0) {
121121
dp.addTo(actualParent, dp.get(nextLeaf) - actualParentCost);
122122
parentArray.set(nextLeaf, actualParent);
123123
parentCostArray.set(nextLeaf, actualParentCost);

algo/src/main/java/org/neo4j/gds/similarity/filteredknn/ExistingTargetNodeFiltering.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static ExistingTargetNodeFiltering create(
8989
}
9090
});
9191

92-
var seededOptimally = (startingSeeds[k] == -1) && (optionalSimilarityFunction.isPresent()); //if there less than `k+1` targets, we optimally find solution just by seeding.
92+
var seededOptimally = (startingSeeds[k] == -1) && optionalSimilarityFunction.isPresent(); //if there less than `k+1` targets, we optimally find solution just by seeding.
9393
return new ExistingTargetNodeFiltering(
9494
neighbourConsumers,
9595
new SeedingSummary(nodeCountAdder.longValue(), nodepairAdder.longValue(), seededOptimally)

algo/src/main/java/org/neo4j/gds/similarity/filteredknn/FilteredKnn.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private FilteredKnn(
136136
@Override
137137
public FilteredKnnResult compute() {
138138
var seedingSummary = targetNodeFiltering.seedingSummary();
139-
KnnResult result = (seedingSummary.seededOptimally()) ?
139+
KnnResult result = seedingSummary.seededOptimally() ?
140140
new KnnResult(
141141
HugeObjectArray.newArray(NeighborList.class, 0),
142142
0,

0 commit comments

Comments
 (0)