yahoojapan / NGT

Nearest Neighbor Search with Neighborhood Graph and Tree for High-dimensional Data
Apache License 2.0
1.24k stars 114 forks source link

code issue #80

Closed op-hunter closed 3 years ago

op-hunter commented 3 years ago

the 192th line of file Graph.h on branch master:

void reserve(size_t s) {
    reservedSize = ((s & 7) == 0) ? s : (s & 0xFFFFFFFFFFFFFFF8) + 8;
    resize(reservedSize);
    for (size_t i = (reservedSize & 0xFFFFFFFFFFFFFFF8); i < reservedSize; i++) {
      (*this)[i].first = 0;
    }
      }

I think the for loop always does nothing because i = (reservedSize & 0xFFFFFFFFFFFFFFF8) always equals reservedSize.

masajiro commented 3 years ago

Thanks! I will update this part in the next version.

masajiro commented 3 years ago

I have fixed this bug.