From f961c8b2d0276d5df93da910c55f0ab5b09c2053 Mon Sep 17 00:00:00 2001 From: Techatrix Date: Mon, 6 Jan 2025 10:20:35 +0100 Subject: [PATCH] remove offsets.rangeLessThan --- src/diff.zig | 2 +- src/offsets.zig | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/diff.zig b/src/diff.zig index 98163a8f3..32779787f 100644 --- a/src/diff.zig +++ b/src/diff.zig @@ -109,7 +109,7 @@ pub fn applyContentChanges( // https://cs.opensource.google/go/x/tools/+/master:internal/lsp/diff/diff.go;l=40 fn textEditLessThan(_: void, lhs: types.TextEdit, rhs: types.TextEdit) bool { - return offsets.rangeLessThan(lhs.range, rhs.range); + return offsets.positionLessThan(lhs.range.start, rhs.range.start) or offsets.positionLessThan(lhs.range.end, rhs.range.end); } /// Caller owns returned memory. diff --git a/src/offsets.zig b/src/offsets.zig index 1ef72a959..839eb4752 100644 --- a/src/offsets.zig +++ b/src/offsets.zig @@ -1046,10 +1046,6 @@ fn testGetNCodeUnitByteCount(text: []const u8, n: [3]usize) !void { try std.testing.expectEqual(n[0], getNCodeUnitByteCount(text, n[2], .@"utf-32")); } -pub fn rangeLessThan(a: types.Range, b: types.Range) bool { - return positionLessThan(a.start, b.start) or positionLessThan(a.end, b.end); -} - pub fn positionLessThan(a: types.Position, b: types.Position) bool { if (a.line < b.line) { return true;