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

Co-Authored-By: whitequark <[email protected]>
This commit is contained in:
Alberto Gonzalez
2020-06-19 21:04:29 +00:00
co-authored by whitequark
parent e5a2d17b5d
commit d71a9badda
+2 -2
View File
@@ -363,7 +363,7 @@ public:
public:
const_iterator() { }
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; }
@@ -381,7 +381,7 @@ public:
public:
iterator() { }
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; }