Skip to content

Commit cabb762

Browse files
Use std::distance in size()
1 parent 8732ba1 commit cabb762

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

cbmc/src/util/overlay_map.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ class overlay_mapt
7676
size_t size() const
7777
{
7878
// TODO: improve this!
79-
size_t count = 0;
80-
for(auto it = cbegin(); it != cend(); ++it)
81-
++count;
82-
return count;
79+
return std::distance(cbegin(), cend());
8380
}
8481

8582
bool empty() const

0 commit comments

Comments
 (0)