diff options
author | Alberto Gonzalez <boqwxp@airmail.cc> | 2020-06-19 20:57:27 +0000 |
---|---|---|
committer | Alberto Gonzalez <boqwxp@airmail.cc> | 2020-06-19 21:04:29 +0000 |
commit | d71a9badda20d48bcd4031f030d2d0901f837261 (patch) | |
tree | ba246844f224e1b2ff33f70c6099e8d812b6f883 /kernel | |
parent | e5a2d17b5dffc69c9994d48c2c12288865b80156 (diff) | |
download | yosys-d71a9badda20d48bcd4031f030d2d0901f837261.tar.gz yosys-d71a9badda20d48bcd4031f030d2d0901f837261.tar.bz2 yosys-d71a9badda20d48bcd4031f030d2d0901f837261.zip |
dict: Remove guard for past-the-end iterators that might mask problems in static analysis.
Co-Authored-By: whitequark <whitequark@whitequark.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/hashlib.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/hashlib.h b/kernel/hashlib.h index 52dfd1280..a523afadd 100644 --- a/kernel/hashlib.h +++ b/kernel/hashlib.h @@ -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; } |