Add only components with non zero nodes

This commit is contained in:
Viswanath Kuchibhotla 2024-12-18 23:13:33 +05:30
parent ea82561520
commit d6ed90d5eb
1 changed files with 3 additions and 1 deletions

View File

@ -106,7 +106,9 @@ public class HnswUtil {
} else {
entryPoint = connectedNodes.nextSetBit(0);
}
components.add(new Component(entryPoint, total));
if (total > 0) {
components.add(new Component(entryPoint, total));
}
if (level == 0) {
int nextClear = nextClearBit(connectedNodes, 0);
while (nextClear != NO_MORE_DOCS) {