Skip to content

Commit 1d6d23f

Browse files
ahuber21rfsaliev
authored andcommitted
fix DynamicVamanaIndex::check_storage_kind() implementation
1 parent eafc674 commit 1d6d23f

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

bindings/cpp/src/dynamic_vamana_index.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,19 @@ using DynamicVamanaIndexLeanVecImplManager =
126126

127127
// DynamicVamanaIndex interface implementation
128128
Status DynamicVamanaIndex::check_storage_kind(StorageKind storage_kind) noexcept {
129-
return runtime_error_wrapper([&] {
130-
return storage::is_supported_storage_kind(storage_kind)
131-
? Status_Ok
132-
: Status(
133-
ErrorCode::INVALID_ARGUMENT,
134-
"The specified storage kind is not compatible with the "
135-
"DynamicVamanaIndex"
136-
);
129+
bool supported = false;
130+
auto status = runtime_error_wrapper([&] {
131+
supported = storage::is_supported_storage_kind(storage_kind);
137132
});
133+
if (!status.ok()) {
134+
return status;
135+
}
136+
return supported ? Status_Ok
137+
: Status(
138+
ErrorCode::INVALID_ARGUMENT,
139+
"The specified storage kind is not compatible with the "
140+
"DynamicVamanaIndex"
141+
);
138142
}
139143

140144
Status DynamicVamanaIndex::build(

0 commit comments

Comments
 (0)