Skip to content

Commit

Permalink
chore(search): Fix deprecated functions (#3933)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Oleshko <[email protected]>
  • Loading branch information
dranikpg authored Oct 15, 2024
1 parent e9e169d commit 7870f59
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/search/rax_tree.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <cassert>
#include <memory>
#include <optional>
#include <string_view>
#include <utility>
Expand Down Expand Up @@ -119,7 +120,7 @@ template <typename V> struct RaxTreeMap {
V* old = nullptr;
raxRemove(tree_, to_key_ptr(it->first.data()), it->first.size(),
reinterpret_cast<void**>(&old));
alloc_.destroy(old);
std::allocator_traits<decltype(alloc_)>::destroy(alloc_, old);
alloc_.deallocate(old, 1);
}

Expand All @@ -144,7 +145,7 @@ std::pair<typename RaxTreeMap<V>::FindIterator, bool> RaxTreeMap<V>::try_emplace
return {it, false};

V* ptr = alloc_.allocate(1);
alloc_.construct(ptr, std::forward<Args>(args)...);
std::allocator_traits<decltype(alloc_)>::construct(alloc_, ptr, std::forward<Args>(args)...);

V* old = nullptr;
raxInsert(tree_, to_key_ptr(key), key.size(), ptr, reinterpret_cast<void**>(&old));
Expand Down

0 comments on commit 7870f59

Please sign in to comment.