mirror of https://gitee.com/bigwinds/arangodb
move static variable from function into TU scope
This commit is contained in:
parent
02760bff67
commit
d6d8f321e7
|
@ -64,13 +64,13 @@ arangodb::velocypack::StringRef const SortModeUnset("unset");
|
||||||
arangodb::velocypack::StringRef const SortModeMinElement("minelement");
|
arangodb::velocypack::StringRef const SortModeMinElement("minelement");
|
||||||
arangodb::velocypack::StringRef const SortModeHeap("heap");
|
arangodb::velocypack::StringRef const SortModeHeap("heap");
|
||||||
|
|
||||||
|
std::map<arangodb::velocypack::StringRef, GatherNode::SortMode> const NameToValue{
|
||||||
|
{SortModeMinElement, GatherNode::SortMode::MinElement},
|
||||||
|
{SortModeHeap, GatherNode::SortMode::Heap},
|
||||||
|
{SortModeUnset, GatherNode::SortMode::Default}};
|
||||||
|
|
||||||
bool toSortMode(arangodb::velocypack::StringRef const& str, GatherNode::SortMode& mode) noexcept {
|
bool toSortMode(arangodb::velocypack::StringRef const& str, GatherNode::SortMode& mode) noexcept {
|
||||||
// std::map ~25-30% faster than std::unordered_map for small number of elements
|
// std::map ~25-30% faster than std::unordered_map for small number of elements
|
||||||
static std::map<arangodb::velocypack::StringRef, GatherNode::SortMode> const NameToValue{
|
|
||||||
{SortModeMinElement, GatherNode::SortMode::MinElement},
|
|
||||||
{SortModeHeap, GatherNode::SortMode::Heap},
|
|
||||||
{SortModeUnset, GatherNode::SortMode::Default}};
|
|
||||||
|
|
||||||
auto const it = NameToValue.find(str);
|
auto const it = NameToValue.find(str);
|
||||||
|
|
||||||
if (it == NameToValue.end()) {
|
if (it == NameToValue.end()) {
|
||||||
|
|
Loading…
Reference in New Issue