| 116 | } |
| 117 | |
| 118 | bool InsertSorted(std::vector<StoryId> &list, StoryId id) { |
| 119 | const auto i = ranges::lower_bound(list, id, std::greater<>()); |
| 120 | if (i != end(list) && *i == id) { |
| 121 | return false; |
| 122 | } |
| 123 | list.insert(i, id); |
| 124 | return true; |
| 125 | } |
| 126 | |
| 127 | bool RemoveSorted(std::vector<StoryId> &list, StoryId id) { |
| 128 | const auto i = ranges::lower_bound(list, id, std::greater<>()); |
no test coverage detected