util/Intrusive*: move constant_time_size to an options struct

This makes it easier to add more options later.
This commit is contained in:
Max Kellermann
2023-09-11 18:48:21 +02:00
committed by Max Kellermann
parent 1f495efb46
commit f01793ad4a
8 changed files with 44 additions and 31 deletions

View File

@@ -1,8 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project
#ifndef MPD_REMOTE_TAG_CACHE_HXX
#define MPD_REMOTE_TAG_CACHE_HXX
#pragma once
#include "input/RemoteTagScanner.hxx"
#include "tag/Tag.hxx"
@@ -84,12 +83,13 @@ class RemoteTagCache final {
*/
ItemList invoke_list;
IntrusiveHashSet<Item, 127,
IntrusiveHashSetOperators<std::hash<std::string_view>,
std::equal_to<std::string_view>,
Item::GetUri>,
IntrusiveHashSetBaseHookTraits<Item>,
true> map;
IntrusiveHashSet<
Item, 127,
IntrusiveHashSetOperators<std::hash<std::string_view>,
std::equal_to<std::string_view>,
Item::GetUri>,
IntrusiveHashSetBaseHookTraits<Item>,
IntrusiveHashSetOptions{.constant_time_size = true}> map;
public:
RemoteTagCache(EventLoop &event_loop,
@@ -107,5 +107,3 @@ private:
void ItemResolved(Item &item) noexcept;
};
#endif