Skip to content

Commit

Permalink
[Fix] Symcache: Do not use C style comparators in C++ sorts
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Jun 28, 2022
1 parent cbdb219 commit ca367c4
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions src/libserver/symcache/symcache_impl.cxx
Expand Up @@ -96,25 +96,11 @@ auto symcache::init() -> bool
}

/* Sorting stuff */
auto postfilters_cmp = [](const auto &it1, const auto &it2) -> int {
if (it1->priority > it2->priority) {
return 1;
}
else if (it1->priority == it2->priority) {
return 0;
}

return -1;
constexpr auto postfilters_cmp = [](const auto &it1, const auto &it2) -> bool {
return it1->priority < it2->priority;
};
auto prefilters_cmp = [](const auto &it1, const auto &it2) -> int {
if (it1->priority > it2->priority) {
return -1;
}
else if (it1->priority == it2->priority) {
return 0;
}

return 1;
constexpr auto prefilters_cmp = [](const auto &it1, const auto &it2) -> bool {
return it1->priority > it2->priority;
};

msg_debug_cache("sorting stuff");
Expand Down

0 comments on commit ca367c4

Please sign in to comment.