-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
67 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// Created by alik on 5/18/18. | ||
// | ||
#pragma once | ||
#ifndef UNPRECACHER_FAST_UNORDERED_STRING_MAP | ||
#define UNPRECACHER_FAST_UNORDERED_STRING_MAP | ||
|
||
#include <boost/multi_index_container.hpp> | ||
#include <boost/multi_index/hashed_index.hpp> | ||
#include <boost/multi_index/member.hpp> | ||
#include <string> | ||
#include <string_view> | ||
|
||
namespace up { | ||
|
||
namespace detail { | ||
struct universal_string_hash { | ||
inline std::size_t operator()(const std::string &v) const { | ||
return std::hash<std::string>()(v); | ||
} | ||
|
||
inline std::size_t operator()(const std::string_view &v) const { | ||
return std::hash<std::string_view>()(v); | ||
} | ||
}; | ||
|
||
struct universal_equal_to { | ||
template<typename T, typename U> | ||
inline bool operator()(const T &v1, const U &v2) const { | ||
return v1 == v2; | ||
} | ||
}; | ||
|
||
using namespace boost::multi_index; | ||
template<typename T> | ||
using unordered_string_map = multi_index_container< | ||
std::pair<std::string, T>, | ||
indexed_by< | ||
hashed_unique< | ||
member< | ||
std::pair<std::string, T>, | ||
std::string, | ||
&std::pair<std::string, T>::first | ||
>, | ||
universal_string_hash, | ||
universal_equal_to | ||
> | ||
> | ||
>; | ||
} | ||
|
||
template<typename T> | ||
using fast_unordered_string_map = detail::unordered_string_map<T>; | ||
} | ||
#endif //UNPRECACHER_FAST_UNORDERED_STRING_MAP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ static META_FUNCTIONS gMetaFunctionTable = { | |
plugin_info_t Plugin_info = { | ||
META_INTERFACE_VERSION, | ||
"Ultimate Unprecacher", | ||
"Beta 2.5.2", | ||
"Beta 2.5.3", | ||
"2016/05/18", | ||
"Alik Aslanyan <[email protected]>", | ||
"https://github.com/in-line/metamod_unprecacher", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters