aboutsummaryrefslogtreecommitdiff
path: root/lib/memfs
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2025-01-23 03:40:50 +0700
committerShulhan <ms@kilabit.info>2025-01-23 03:41:10 +0700
commit2a0694d2fa577574b505c4635eb8a824eaf88ddc (patch)
treecce840739c7f59893c3a6a65a1600f9f857c484e /lib/memfs
parent605d847b236dde031a2e387e74298d66a27b5e0a (diff)
downloadpakakeh.go-2a0694d2fa577574b505c4635eb8a824eaf88ddc.tar.xz
all: use for-range with numeric
Go 1.22 now support for-range on numeric value.
Diffstat (limited to 'lib/memfs')
-rw-r--r--lib/memfs/memfs.go3
-rw-r--r--lib/memfs/node.go2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/memfs/memfs.go b/lib/memfs/memfs.go
index e80b7e58..9e02fc95 100644
--- a/lib/memfs/memfs.go
+++ b/lib/memfs/memfs.go
@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: 2018 M. Shulhan <ms@kilabit.info>
+//
// SPDX-License-Identifier: BSD-3-Clause
package memfs
@@ -335,7 +336,7 @@ func (mfs *MemFS) Search(words []string, snippetLen int) (results []SearchResult
}
tokens := libstrings.ToBytes(words)
- for x := 0; x < len(tokens); x++ {
+ for x := range len(tokens) {
tokens[x] = bytes.ToLower(tokens[x])
}
diff --git a/lib/memfs/node.go b/lib/memfs/node.go
index ab75be68..7c04ff63 100644
--- a/lib/memfs/node.go
+++ b/lib/memfs/node.go
@@ -454,7 +454,7 @@ func (node *Node) removeChild(child *Node) *Node {
if child == nil {
return nil
}
- for x := 0; x < len(node.Childs); x++ {
+ for x := range len(node.Childs) {
if node.Childs[x] != child {
continue
}