Skip to content

Commit 3fad6b0

Browse files
committed
Bugfixes, cleanup
1 parent e41bc6b commit 3fad6b0

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ project(hnswlib
55

66
include(GNUInstallDirs)
77
include(CheckCXXCompilerFlag)
8-
include(FetchContent)
98

109
# These example/test targets catch exceptions, so exceptions should always be
1110
# enabled building these files even if they are disabled in other targets.

hnswlib/bruteforce.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class BruteforceSearch : public AlgorithmInterface<dist_t> {
7474
idx = search->second;
7575
} else {
7676
if (cur_element_count >= maxelements_) {
77-
HNSWLIB_THROW_RUNTIME_ERROR("The number of elements exceeds the specified limit");
77+
return Status("The number of elements exceeds the specified limit");
7878
}
7979
idx = cur_element_count;
8080
dict_external_to_internal[label] = idx;

hnswlib/hnswlib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ class AlgorithmInterface {
316316

317317
// Here searchKnn returns the result in the order of further first.
318318
auto status_or_result = searchKnnNoExceptions(query_data, k, isIdAllowed);
319-
if (status_or_result.ok()) {
319+
if (!status_or_result.ok()) {
320320
return status_or_result.status();
321321
}
322322
auto ret = std::move(status_or_result.value());

0 commit comments

Comments
 (0)