mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-14 17:13:40 +00:00
[map] Fix use-after-move issue
This commit is contained in:
parent
a67a7867d2
commit
0f0b3bee21
1 changed files with 5 additions and 1 deletions
|
@ -258,7 +258,11 @@ struct hb_hashmap_t
|
|||
template <typename VV>
|
||||
bool set (const K &key, VV&& value, bool overwrite = true) { return set_with_hash (key, hb_hash (key), std::forward<VV> (value), overwrite); }
|
||||
template <typename VV>
|
||||
bool set (K &&key, VV&& value, bool overwrite = true) { return set_with_hash (std::move (key), hb_hash (key), std::forward<VV> (value), overwrite); }
|
||||
bool set (K &&key, VV&& value, bool overwrite = true)
|
||||
{
|
||||
uint32_t hash = hb_hash (key);
|
||||
return set_with_hash (std::move (key), hash, std::forward<VV> (value), overwrite);
|
||||
}
|
||||
|
||||
const V& get_with_hash (const K &key, uint32_t hash) const
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue