dict: Remove guard for past-the-end iterators that might mask problems in static analysis.

Co-Authored-By: whitequark <whitequark@whitequark.org>
This commit is contained in:
Alberto Gonzalez 2020-06-19 20:57:27 +00:00
parent e5a2d17b5d
commit d71a9badda
No known key found for this signature in database
GPG Key ID: 8395A8BA109708B2
1 changed files with 2 additions and 2 deletions

View File

@ -363,7 +363,7 @@ public:
public: public:
const_iterator() { } const_iterator() { }
const_iterator operator++() { index--; return *this; } const_iterator operator++() { index--; return *this; }
const_iterator operator+=(int amt) { index -= amt; if(index < 0) index = -1; return *this; } const_iterator operator+=(int amt) { index -= amt; return *this; }
bool operator<(const const_iterator &other) const { return index > other.index; } bool operator<(const const_iterator &other) const { return index > other.index; }
bool operator==(const const_iterator &other) const { return index == other.index; } bool operator==(const const_iterator &other) const { return index == other.index; }
bool operator!=(const const_iterator &other) const { return index != other.index; } bool operator!=(const const_iterator &other) const { return index != other.index; }
@ -381,7 +381,7 @@ public:
public: public:
iterator() { } iterator() { }
iterator operator++() { index--; return *this; } iterator operator++() { index--; return *this; }
iterator operator+=(int amt) { index -= amt; if(index < 0) index = -1; return *this; } iterator operator+=(int amt) { index -= amt; return *this; }
bool operator<(const iterator &other) const { return index > other.index; } bool operator<(const iterator &other) const { return index > other.index; }
bool operator==(const iterator &other) const { return index == other.index; } bool operator==(const iterator &other) const { return index == other.index; }
bool operator!=(const iterator &other) const { return index != other.index; } bool operator!=(const iterator &other) const { return index != other.index; }