diff options
Diffstat (limited to 'lexlib/SparseState.h')
-rw-r--r-- | lexlib/SparseState.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lexlib/SparseState.h b/lexlib/SparseState.h index 4e7ac92e3..6286c76af 100644 --- a/lexlib/SparseState.h +++ b/lexlib/SparseState.h @@ -17,12 +17,12 @@ class SparseState { struct State { Sci_Position position; T value; - State(Sci_Position position_, T value_) : position(position_), value(value_) { + constexpr State(Sci_Position position_, T value_) noexcept : position(position_), value(value_) { } - inline bool operator<(const State &other) const { + inline bool operator<(const State &other) const noexcept { return position < other.position; } - inline bool operator==(const State &other) const { + inline bool operator==(const State &other) const noexcept { return (position == other.position) && (value == other.value); } }; @@ -31,7 +31,7 @@ class SparseState { stateVector states; typename stateVector::iterator Find(Sci_Position position) { - State searchValue(position, T()); + const State searchValue(position, T()); return std::lower_bound(states.begin(), states.end(), searchValue); } |