Skip to content

Commit fc2cfd0

Browse files
tidy up
1 parent d84114d commit fc2cfd0

3 files changed

Lines changed: 10 additions & 15 deletions

File tree

src/main/java/graphql/execution/MergedField.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ public List<DeferredExecution> getDeferredExecutions() {
140140
}
141141

142142
/**
143-
* TODO Javadoc
144-
* @return
143+
* Returns true if this field is part of a deferred execution
144+
* @return true if this field is part of a deferred execution
145145
*/
146146
@ExperimentalApi
147147
public boolean isDeferred() {

src/main/java/graphql/execution/instrumentation/dataloader/LevelMap.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
public class LevelMap {
1212

1313
// A reasonable default that guarantees no additional allocations for most use cases.
14-
private static final int DEFAULT_INITIAL_SIZE = 8;
14+
private static final int DEFAULT_INITIAL_SIZE = 16;
1515

1616
// this array is mutable in both size and contents.
1717
private int[] countsByLevel;
@@ -54,14 +54,13 @@ private void maybeResize(int level) {
5454

5555
@Override
5656
public String toString() {
57-
return Arrays.toString(this.countsByLevel);
58-
// StringBuilder result = new StringBuilder();
59-
// result.append("IntMap[");
60-
// for (int i = 0; i < countsByLevel.length; i++) {
61-
// result.append("level=").append(i).append(",count=").append(countsByLevel[i]).append(" ");
62-
// }
63-
// result.append("]");
64-
// return result.toString();
57+
StringBuilder result = new StringBuilder();
58+
result.append("IntMap[");
59+
for (int i = 0; i < countsByLevel.length; i++) {
60+
result.append("level=").append(i).append(",count=").append(countsByLevel[i]).append(" ");
61+
}
62+
result.append("]");
63+
return result.toString();
6564
}
6665

6766
public String toString(int level) {

src/test/groovy/graphql/execution/instrumentation/dataloader/DeferWithDataLoaderTest.groovy

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ class DeferWithDataLoaderTest extends Specification {
8383
then:
8484
combined.errors == null
8585
combined.data == expectedData
86-
87-
// With deferred results, we don't achieve the same efficiency.
88-
// batchCompareDataFetchers.departmentsForShopsBatchLoaderCounter.get() == 3
89-
// batchCompareDataFetchers.productsForDepartmentsBatchLoaderCounter.get() == 3
9086
}
9187

9288
def "multiple fields on same defer block"() {

0 commit comments

Comments
 (0)