Skip to content

Commit

Permalink
✏️ fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Nov 9, 2021
1 parent d2ddce0 commit 80067d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions include/nlohmann/ordered_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,

iterator erase(iterator first, iterator last)
{
const auto offset = std::distance(Container::begin(), first);
const auto elements_affected = std::distance(first, last);
const auto offset = std::distance(Container::begin(), first);

// This is the start situation. We need to delete elements_affected
// elements (3 in this example: e, f, g), and need to return an
Expand Down Expand Up @@ -153,8 +153,8 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
// first last

// first is now pointing past the last deleted element, but we cannot
// use this iterator got invalidated by the resize call. Instead, we
// can return begin() + offset.
// use this iterator, because it may have been invalidated by the
// resize call. Instead, we can return begin() + offset.
return Container::begin() + offset;
}

Expand Down
6 changes: 3 additions & 3 deletions single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17499,8 +17499,8 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,

iterator erase(iterator first, iterator last)
{
const auto offset = std::distance(Container::begin(), first);
const auto elements_affected = std::distance(first, last);
const auto offset = std::distance(Container::begin(), first);

// This is the start situation. We need to delete elements_affected
// elements (3 in this example: e, f, g), and need to return an
Expand Down Expand Up @@ -17540,8 +17540,8 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
// first last

// first is now pointing past the last deleted element, but we cannot
// use this iterator got invalidated by the resize call. Instead, we
// can return begin() + offset.
// use this iterator, because it may have been invalidated by the
// resize call. Instead, we can return begin() + offset.
return Container::begin() + offset;
}

Expand Down

0 comments on commit 80067d9

Please sign in to comment.