forked from TrueCloudLab/frostfs-node
[#1317] go.mod: Use range over int
Since Go 1.22 a "for" statement with a "range" clause is able to iterate through integer values from zero to an upper limit. gopatch script: @@ var i, e expression @@ -for i := 0; i <= e - 1; i++ { +for i := range e { ... } @@ var i, e expression @@ -for i := 0; i <= e; i++ { +for i := range e + 1 { ... } @@ var i, e expression @@ -for i := 0; i < e; i++ { +for i := range e { ... } Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
This commit is contained in:
parent
2b3fc50681
commit
a685fcdc96
66 changed files with 135 additions and 135 deletions
|
@ -34,7 +34,7 @@ func benchmarkTreeVsSearch(b *testing.B, objCount int) {
|
|||
d := pilorama.CIDDescriptor{CID: cid, Position: 0, Size: 1}
|
||||
treeID := "someTree"
|
||||
|
||||
for i := 0; i < objCount; i++ {
|
||||
for i := range objCount {
|
||||
obj := testutil.GenerateObjectWithCID(cid)
|
||||
testutil.AddAttribute(obj, pilorama.AttributeFilename, strconv.Itoa(i))
|
||||
err := Put(context.Background(), te.ng, obj)
|
||||
|
@ -56,7 +56,7 @@ func benchmarkTreeVsSearch(b *testing.B, objCount int) {
|
|||
fs.AddFilter(pilorama.AttributeFilename, strconv.Itoa(objCount/2), objectSDK.MatchStringEqual)
|
||||
prm.WithFilters(fs)
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
res, err := te.ng.Select(context.Background(), prm)
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
|
@ -67,7 +67,7 @@ func benchmarkTreeVsSearch(b *testing.B, objCount int) {
|
|||
}
|
||||
})
|
||||
b.Run("TreeGetByPath", func(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
nodes, err := te.ng.TreeGetByPath(context.Background(), cid, treeID, pilorama.AttributeFilename, []string{strconv.Itoa(objCount / 2)}, true)
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue