From 57da6a81ab1b3721c923dd213b7e1072b1e07573 Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Thu, 11 May 2017 00:20:00 -0700 Subject: [PATCH] Make update delta work a bit better. Still buggy though. --- src/position.cc | 4 +++- src/query.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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; } };