Skip to content

Commit adb9e3c

Browse files
Bug fix counting top-level domains in node list
For the last block of domain names in reversed notation, sharing the same TLD prefix, two counts are returned: the correct count and count "1".
1 parent 4696f6d commit adb9e3c

File tree

1 file changed

+4
-1
lines changed
  • src/main/java/org/commoncrawl/webgraph/explore

1 file changed

+4
-1
lines changed

src/main/java/org/commoncrawl/webgraph/explore/Graph.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,11 @@ public Stream<Entry<String, Long>> topLevelDomainCounts(IntStream vertexIds) {
255255
}
256256
count++;
257257
}
258-
curr = next;
259258
res.add(new SimpleEntry<>(tld, count));
259+
curr = next;
260+
if (!iter.hasNext()) {
261+
break;
262+
}
260263
} while (curr > -1);
261264
}
262265
return res.stream().sorted(Collections.reverseOrder(Map.Entry.comparingByValue()));

0 commit comments

Comments
 (0)