diff options
author | Evan Brown <ezb@google.com> | 2022-10-18 11:45:09 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-10-18 11:45:57 -0700 |
commit | 24c32c7de239a2d4c81f67d7eb241c0c4aa38a63 (patch) | |
tree | 65106acc7f2437fdd947e60b37fb199f6da1f3d0 /absl/container/internal/btree_container.h | |
parent | 4bc7568c70822dae40eea3f27a3051a618021651 (diff) |
Use btree iterator subtraction instead of std::distance in erase_range() and count().
PiperOrigin-RevId: 481979737
Change-Id: I69f53665b0463a7d8d80f2a3feedfdd95d32b012
Diffstat (limited to 'absl/container/internal/btree_container.h')
-rw-r--r-- | absl/container/internal/btree_container.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/absl/container/internal/btree_container.h b/absl/container/internal/btree_container.h index fc2f740a..3e259861 100644 --- a/absl/container/internal/btree_container.h +++ b/absl/container/internal/btree_container.h @@ -107,7 +107,7 @@ class btree_container { template <typename K = key_type> size_type count(const key_arg<K> &key) const { auto equal_range = this->equal_range(key); - return std::distance(equal_range.first, equal_range.second); + return equal_range.second - equal_range.first; } template <typename K = key_type> iterator find(const key_arg<K> &key) { |