Skip to content

Commit c913a8b

Browse files
committed
fix: prevent unnecessary key updates in index_gt::update
1 parent 13c3fd9 commit c913a8b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/usearch/index.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2987,7 +2987,8 @@ class index_gt {
29872987
}
29882988
form_reverse_links_(metric, updated_slot, closest_view, value, level, context);
29892989
}
2990-
updated_node.key(key);
2990+
if (updated_node.key() != key)
2991+
updated_node.key(key);
29912992

29922993
// Normalize stats
29932994
result.computed_distances = context.computed_distances - result.computed_distances;

0 commit comments

Comments
 (0)