MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / equal_range

Method equal_range

src/core/multimap.hpp:301–309  ·  view source on GitHub ↗

* Get a pair of iterators specifying a range of items with equal keys. * @param key Key to look for. * @return Range of items with given key. */

Source from the content-addressed store, hash-verified

299 * @return Range of items with given key.
300 */
301 std::pair<iterator, iterator> equal_range(const Tkey &key)
302 {
303 MapIterator begin(this->lower_bound(key));
304 if (begin != this->Map::end() && begin->first == key) {
305 MapIterator end = begin;
306 return std::make_pair(begin, ++end);
307 }
308 return std::make_pair(begin, begin);
309 }
310
311 /**
312 * Get a pair of constant iterators specifying a range of items with equal keys.

Callers 4

ShiftCargoMethod · 0.80
CountCargoWaitingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected