summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/priority_queue/binary_heap.go1
-rw-r--r--pkg/priority_queue/binary_heap_test.go4
-rw-r--r--pkg/priority_queue/interface.go2
3 files changed, 3 insertions, 4 deletions
diff --git a/pkg/priority_queue/binary_heap.go b/pkg/priority_queue/binary_heap.go
index 514ca460..fc043927 100644
--- a/pkg/priority_queue/binary_heap.go
+++ b/pkg/priority_queue/binary_heap.go
@@ -56,7 +56,6 @@ func (bh *BinHeap) fixDown(curr, end int) {
}
idxToSwap := cOneIdx
- // oh my, so unsafe
if cTwoIdx > -1 && (bh.items)[cTwoIdx].Priority() < (bh.items)[cOneIdx].Priority() {
idxToSwap = cTwoIdx
}
diff --git a/pkg/priority_queue/binary_heap_test.go b/pkg/priority_queue/binary_heap_test.go
index f30cf8d8..663741ad 100644
--- a/pkg/priority_queue/binary_heap_test.go
+++ b/pkg/priority_queue/binary_heap_test.go
@@ -32,8 +32,8 @@ func (t Test) ID() string {
return "none"
}
-func (t Test) Priority() uint64 {
- return uint64(t)
+func (t Test) Priority() int64 {
+ return int64(t)
}
func TestBinHeap_Init(t *testing.T) {
diff --git a/pkg/priority_queue/interface.go b/pkg/priority_queue/interface.go
index 1efebf1c..d64aaf3d 100644
--- a/pkg/priority_queue/interface.go
+++ b/pkg/priority_queue/interface.go
@@ -12,7 +12,7 @@ type Item interface {
ID() string
// Priority returns the Item's priority to sort
- Priority() uint64
+ Priority() int64
// Body is the Item payload
Body() []byte