diff options
author | Özgür Kesim <oec@codeblau.de> | 2024-01-07 20:00:15 +0100 |
---|---|---|
committer | Özgür Kesim <oec@codeblau.de> | 2024-01-07 20:00:15 +0100 |
commit | cde0b392651d8eb542de8f985b559d4db37b44cd (patch) | |
tree | cf38b6ce70a95ab5e6084201390227089464d557 | |
parent | dc372d272f1accfb9fcb4dd4ab55cf7295a58662 (diff) |
use ptr for ordering
-rw-r--r-- | issues.go | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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] |