diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2018-10-05 20:44:09 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2018-10-05 20:44:09 +0000 |
commit | b391bbe70f32c125645f39f299a906ff2aaaed9a (patch) | |
tree | 01d9536e05f821b329fd12220c174fbce84e4ddf | |
parent | a06fc46c5e71315ab460fb11ef1a6e05816e396a (diff) |
simplify slightly
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/metrics/point_map_collection.cpp | 20 | ||||
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/metrics/point_map_collection.h | 1 |
2 files changed, 2 insertions, 19 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/point_map_collection.cpp b/staging_vespalib/src/vespa/vespalib/metrics/point_map_collection.cpp index 9909eb04cdc..892a1abcb36 100644 --- a/staging_vespalib/src/vespa/vespalib/metrics/point_map_collection.cpp +++ b/staging_vespalib/src/vespa/vespalib/metrics/point_map_collection.cpp @@ -25,24 +25,8 @@ HashedPointMap::operator< (const HashedPointMap &other) const if (_map.size() != other._map.size()) { return _map.size() < other._map.size(); } - // sizes equal, iterate in parallel - for (auto m = _map.begin(), o = other._map.begin(); - m != _map.end(); - ++m, ++o) - { - const Dimension& d1 = m->first; - const Dimension& d2 = o->first; - if (d1 != d2) { - return d1 < d2; - } - const Label &l1 = m->second; - const Label &l2 = o->second; - if (l1 != l2) { - return l1 < l2; - } - } - // equal - return false; + // sizes equal, fall back to std::map::operator< + return _map < other._map; } using Guard = std::lock_guard<std::mutex>; diff --git a/staging_vespalib/src/vespa/vespalib/metrics/point_map_collection.h b/staging_vespalib/src/vespa/vespalib/metrics/point_map_collection.h index 3474bff6188..adbd7f53725 100644 --- a/staging_vespalib/src/vespa/vespalib/metrics/point_map_collection.h +++ b/staging_vespalib/src/vespa/vespalib/metrics/point_map_collection.h @@ -15,7 +15,6 @@ private: const PointMap _map; size_t _hash; public: - HashedPointMap() : _map(), _hash(0) {} HashedPointMap(PointMap &&from); bool operator< (const HashedPointMap &other) const; |