diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-06-28 19:57:46 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-06-28 19:57:46 +0100 |
commit | ca367c4a17dc6658d8a58122f6a28ced1b4afbb1 (patch) | |
tree | 412819a189c690e95ee64d906577cc82dad363be /src/libserver/symcache | |
parent | cbdb21960f2a885237c8e8179ac1d698ad9c57c2 (diff) | |
download | rspamd-ca367c4a17dc6658d8a58122f6a28ced1b4afbb1.tar.gz rspamd-ca367c4a17dc6658d8a58122f6a28ced1b4afbb1.zip |
[Fix] Symcache: Do not use C style comparators in C++ sorts
Diffstat (limited to 'src/libserver/symcache')
-rw-r--r-- | src/libserver/symcache/symcache_impl.cxx | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/libserver/symcache/symcache_impl.cxx b/src/libserver/symcache/symcache_impl.cxx index 479617c4a..52a2042b1 100644 --- a/src/libserver/symcache/symcache_impl.cxx +++ b/src/libserver/symcache/symcache_impl.cxx @@ -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"); |