diff --git a/src/position.cc b/src/position.cc index f5384eb9..f729dbe7 100644 --- a/src/position.cc +++ b/src/position.cc @@ -64,7 +64,9 @@ bool Position::operator==(const Position& that) const { bool Position::operator!=(const Position& that) const { return !(*this == that); } bool Position::operator<(const Position& that) const { - return line < that.line && column < that.column; + if (line < that.line) + return true; + return line == that.line && column < that.column; } Range::Range() {} diff --git a/src/query.h b/src/query.h index b41fe190..8be69f27 100644 --- a/src/query.h +++ b/src/query.h @@ -110,7 +110,9 @@ struct QueryFuncRef { } bool operator!=(const QueryFuncRef& that) const { return !(*this == that); } bool operator<(const QueryFuncRef& that) const { - return id_ < that.id_ && loc.range.start < that.loc.range.start; + if (id_ < that.id_) + return true; + return id_ == that.id_ && loc.range.start < that.loc.range.start; } };