Use stdlib maps/slices

This commit is contained in:
Kovid Goyal
2024-05-04 14:34:40 +05:30
parent 4998fe66b9
commit e1b367e1b3
27 changed files with 55 additions and 60 deletions

View File

@@ -15,8 +15,6 @@ import (
"kitty/tools/utils"
"kitty/tools/utils/images"
"kitty/tools/utils/shm"
"golang.org/x/exp/maps"
)
var _ = fmt.Print
@@ -137,7 +135,7 @@ func (self *ImageCollection) ResizeForPageSize(width, height int) {
defer self.mutex.Unlock()
ctx := images.Context{}
keys := maps.Keys(self.images)
keys := utils.Keys(self.images)
ctx.Parallel(0, len(keys), func(nums <-chan int) {
for i := range nums {
img := self.images[keys[i]]
@@ -295,7 +293,7 @@ func (self *ImageCollection) LoadAll() {
self.mutex.Lock()
defer self.mutex.Unlock()
ctx := images.Context{}
all := maps.Values(self.images)
all := utils.Values(self.images)
ctx.Parallel(0, len(self.images), func(nums <-chan int) {
for i := range nums {
img := all[i]

View File

@@ -4,10 +4,9 @@ package loop
import (
"fmt"
"slices"
"time"
"golang.org/x/exp/slices"
"kitty/tools/tty"
"kitty/tools/utils"
)

View File

@@ -4,6 +4,7 @@ package sgr
import (
"fmt"
"slices"
"strconv"
"strings"
"unicode/utf8"
@@ -11,8 +12,6 @@ import (
"kitty/tools/utils"
"kitty/tools/utils/style"
"kitty/tools/wcswidth"
"golang.org/x/exp/slices"
)
var _ = fmt.Print

View File

@@ -6,14 +6,13 @@ import (
"archive/tar"
"bytes"
"fmt"
"maps"
"os"
"os/exec"
"path/filepath"
"slices"
"strings"
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"
"kitty"
"kitty/tools/tty"
"kitty/tools/utils"

View File

@@ -4,12 +4,11 @@ package subseq
import (
"fmt"
"slices"
"strings"
"kitty/tools/utils"
"kitty/tools/utils/images"
"golang.org/x/exp/slices"
)
var _ = fmt.Print