From b0e30477e93bb16b0cf8c7b64aaee35cedf85ca8 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 1 Jul 2024 22:25:56 -0400 Subject: Use heterogeneous comparison for string_view map finds in LLControl and convert controlExists to string_view --- indra/llcommon/llstl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llcommon/llstl.h') diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h index 1b52d94258..e3999cbdaa 100644 --- a/indra/llcommon/llstl.h +++ b/indra/llcommon/llstl.h @@ -226,11 +226,11 @@ void delete_and_clear_array(T*& ptr) // foo[2] = "hello"; // const char* bar = get_ptr_in_map(foo, 2); // bar -> "hello" // const char* baz = get_ptr_in_map(foo, 3); // baz == NULL -template -inline T* get_ptr_in_map(const std::map& inmap, const K& key) +template +inline typename T::mapped_type get_ptr_in_map(const T& inmap, typename T::key_type const& key) { // Typedef here avoids warnings because of new c++ naming rules. - typedef typename std::map::const_iterator map_iter; + typedef T::const_iterator map_iter; map_iter iter = inmap.find(key); if(iter == inmap.end()) { -- cgit v1.2.3 From fad6a3753757778d4b50d46f44aabd0d3fa3e13b Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 1 Jul 2024 22:58:25 -0400 Subject: Fix test builds --- indra/llcommon/llstl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llstl.h') diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h index e3999cbdaa..7d41c42ba7 100644 --- a/indra/llcommon/llstl.h +++ b/indra/llcommon/llstl.h @@ -230,7 +230,7 @@ template inline typename T::mapped_type get_ptr_in_map(const T& inmap, typename T::key_type const& key) { // Typedef here avoids warnings because of new c++ naming rules. - typedef T::const_iterator map_iter; + typedef typename T::const_iterator map_iter; map_iter iter = inmap.find(key); if(iter == inmap.end()) { -- cgit v1.2.3