1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-15 16:55:06 +00:00

refactor: modernize Go code

This commit is contained in:
Oleksandr Redko
2026-01-06 11:52:05 +02:00
parent 62ef283943
commit 158af1e1ba
12 changed files with 55 additions and 119 deletions

View File

@@ -7,11 +7,11 @@ func (h entryHeap) Len() int { return len(h) }
func (h entryHeap) Less(i, j int) bool { return h[i].Size < h[j].Size }
func (h entryHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
func (h *entryHeap) Push(x interface{}) {
func (h *entryHeap) Push(x any) {
*h = append(*h, x.(dirEntry))
}
func (h *entryHeap) Pop() interface{} {
func (h *entryHeap) Pop() any {
old := *h
n := len(old)
x := old[n-1]
@@ -26,11 +26,11 @@ func (h largeFileHeap) Len() int { return len(h) }
func (h largeFileHeap) Less(i, j int) bool { return h[i].Size < h[j].Size }
func (h largeFileHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
func (h *largeFileHeap) Push(x interface{}) {
func (h *largeFileHeap) Push(x any) {
*h = append(*h, x.(fileEntry))
}
func (h *largeFileHeap) Pop() interface{} {
func (h *largeFileHeap) Pop() any {
old := *h
n := len(old)
x := old[n-1]