From fae5fe439ea114b96370edbc06bfbc0facd74678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Tue, 26 Nov 2024 21:57:43 -0800 Subject: [PATCH] Removed obsolete maputil.h --- include/bx/maputil.h | 58 -------------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 include/bx/maputil.h diff --git a/include/bx/maputil.h b/include/bx/maputil.h deleted file mode 100644 index 36dba28c9..000000000 --- a/include/bx/maputil.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2010-2024 Branimir Karadzic. All rights reserved. - * License: https://github.com/bkaradzic/bx/blob/master/LICENSE - */ - -#ifndef BX_MAPUTIL_H_HEADER_GUARD -#define BX_MAPUTIL_H_HEADER_GUARD - -#include "bx.h" - -namespace bx -{ - template - typename MapType::iterator mapInsertOrUpdate(MapType& _map, const typename MapType::key_type& _key, const typename MapType::mapped_type& _value) - { - typename MapType::iterator it = _map.lower_bound(_key); - if (it != _map.end() - && !_map.key_comp()(_key, it->first) ) - { - it->second = _value; - return it; - } - - typename MapType::value_type pair(_key, _value); - return _map.insert(it, pair); - } - - template - bool mapRemove(MapType& _map, const typename MapType::value_type::first_type& _first) - { - typename MapType::const_iterator it = _map.find(_first); - if (it != _map.end() ) - { - _map.erase(it); - return true; - } - - return false; - } - - template - bool mapRemove(MapType& _map, const typename MapType::value_type::second_type& _second) - { - for (typename MapType::const_iterator it = _map.begin(), itEnd = _map.end(); it != itEnd; ++it) - { - if (it->second == _second) - { - _map.erase(it); - return true; - } - } - - return false; - } - -} // namespace bx - -#endif // BX_MAPUTIL_H_HEADER_GUARD