Skip to content

Commit

Permalink
switch to go 1.22, use range over integer
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Feb 7, 2024
1 parent f880d62 commit 9d695d4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dictzip/dictzip.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func NewReader(rs io.ReadSeekCloser) (*Reader, error) {

dz.offsets = make([]int64, blockCount+1)
dz.offsets[0] = int64(p)
for i := 0; i < blockCount; i++ {
for i := range blockCount {
dz.offsets[i+1] = dz.offsets[i] + int64(metadata[6+2*i]) + 256*int64(metadata[7+2*i])
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/ilius/go-stardict/v2

go 1.14
go 1.22

require (
github.com/gobwas/glob v0.2.3
Expand Down
2 changes: 1 addition & 1 deletion murmur3/murmur128.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (d *digest128) bmix(p []byte) (tail []byte) {
h1, h2 := d.h1, d.h2

nblocks := len(p) / 16
for i := 0; i < nblocks; i++ {
for i := range nblocks {
t := (*[2]uint64)(unsafe.Pointer(&p[i*16]))
k1, k2 := t[0], t[1]

Expand Down
2 changes: 1 addition & 1 deletion murmur3/murmur_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func bench128(b *testing.B, length int) {
buf := make([]byte, length)
b.SetBytes(int64(length))
b.ResetTimer()
for i := 0; i < b.N; i++ {
for range b.N {
Sum128(buf)
}
}
Expand Down

0 comments on commit 9d695d4

Please # to comment.