From cde0b392651d8eb542de8f985b559d4db37b44cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Sun, 7 Jan 2024 20:00:15 +0100 Subject: [PATCH] use ptr for ordering --- issues.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/issues.go b/issues.go index 48ced5f..88a8ccc 100644 --- a/issues.go +++ b/issues.go @@ -27,7 +27,7 @@ import ( "time" ) -type Issues []Issue +type Issues []*Issue type Issue struct { Id uint32 @@ -96,7 +96,7 @@ type Change struct { Note struct{ id int32 } } -type ByCategory []Issue +type ByCategory []*Issue func (b ByCategory) Len() int { return len(b) } func (b ByCategory) Less(i, j int) bool { @@ -104,7 +104,7 @@ func (b ByCategory) Less(i, j int) bool { } func (b ByCategory) Swap(i, j int) { b[i], b[j] = b[j], b[i] } -type ByAssignment []Issue +type ByAssignment []*Issue func (b ByAssignment) Len() int { return len(b) } func (b ByAssignment) Less(i, j int) bool { @@ -112,13 +112,13 @@ func (b ByAssignment) Less(i, j int) bool { } func (b ByAssignment) Swap(i, j int) { b[i], b[j] = b[j], b[i] } -type ById []Issue +type ById []*Issue func (b ById) Len() int { return len(b) } func (b ById) Less(i, j int) bool { return b[i].Id < b[j].Id } func (b ById) Swap(i, j int) { b[i], b[j] = b[j], b[i] } -type ByTarget []Issue +type ByTarget []*Issue func (b ByTarget) Len() int { return len(b) } func (b ByTarget) Less(i, j int) bool { @@ -126,7 +126,7 @@ func (b ByTarget) Less(i, j int) bool { } func (b ByTarget) Swap(i, j int) { b[i], b[j] = b[j], b[i] } -type ByHandlerAndId []Issue +type ByHandlerAndId []*Issue func (b ByHandlerAndId) Len() int { return len(b) } func (b ByHandlerAndId) Less(i, j int) bool { @@ -238,7 +238,7 @@ func (ms *multiSorter) Swap(i, j int) { } func (ms *multiSorter) Less(i, j int) bool { - p, q := &ms.issues[i], &ms.issues[j] + p, q := ms.issues[i], ms.issues[j] var k int for k = 0; k < len(ms.less)-1; k++ { less := ms.less[k]