| 34 | |
| 35 | template <typename K, typename V> |
| 36 | std::vector<std::pair<K, V>> Sorted(const std::vector<std::pair<K, V>> &m) { |
| 37 | std::vector<std::pair<K, V>> v = m; |
| 38 | std::sort(v.begin(), v.end(), |
| 39 | [](const std::pair<K, V> &p1, const std::pair<K, V> &p2) { |
| 40 | return (p1.second > p2.second || |
| 41 | (p1.second == p2.second && p1.first < p2.first)); |
| 42 | }); |
| 43 | return v; |
| 44 | } |
| 45 | |
| 46 | template <typename K, typename V> |
| 47 | std::vector<std::pair<K, V>> Sorted(const absl::flat_hash_map<K, V> &m) { |
no test coverage detected