1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00

chore(search): Fix deprecated functions (#3933)

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
This commit is contained in:
Vladislav 2024-10-15 22:50:22 +03:00 committed by GitHub
parent e9e169d074
commit 7870f59466
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,7 @@
#pragma once #pragma once
#include <cassert> #include <cassert>
#include <memory>
#include <optional> #include <optional>
#include <string_view> #include <string_view>
#include <utility> #include <utility>
@ -119,7 +120,7 @@ template <typename V> struct RaxTreeMap {
V* old = nullptr; V* old = nullptr;
raxRemove(tree_, to_key_ptr(it->first.data()), it->first.size(), raxRemove(tree_, to_key_ptr(it->first.data()), it->first.size(),
reinterpret_cast<void**>(&old)); reinterpret_cast<void**>(&old));
alloc_.destroy(old); std::allocator_traits<decltype(alloc_)>::destroy(alloc_, old);
alloc_.deallocate(old, 1); alloc_.deallocate(old, 1);
} }
@ -144,7 +145,7 @@ std::pair<typename RaxTreeMap<V>::FindIterator, bool> RaxTreeMap<V>::try_emplace
return {it, false}; return {it, false};
V* ptr = alloc_.allocate(1); 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; V* old = nullptr;
raxInsert(tree_, to_key_ptr(key), key.size(), ptr, reinterpret_cast<void**>(&old)); raxInsert(tree_, to_key_ptr(key), key.size(), ptr, reinterpret_cast<void**>(&old));