Skip to content

Commit 1d8045c

Browse files
committed
refactor: remove redundant variable declarations in for loops
Signed-off-by: efcking <[email protected]>
1 parent 256bfca commit 1d8045c

File tree

5 files changed

+0
-7
lines changed

5 files changed

+0
-7
lines changed

go/libraries/doltcore/remotestorage/chunk_fetcher.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ func fetcherHashSetToGetDlLocsReqsThread(ctx context.Context, reqCh chan hash.Ha
205205
break
206206
}
207207
for h := range hs {
208-
h := h
209208
addrs = append(addrs, h[:])
210209
}
211210
case thisResCh <- thisRes:

go/performance/utils/dolt_builder/run.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ func Run(parentCtx context.Context, commitList []string, profilePath string) err
8282
}()
8383

8484
for _, commit := range commitList {
85-
commit := commit // https://golang.org/doc/faq#closures_and_goroutines
8685
g.Go(func() error {
8786
return buildBinaries(ctx, tempDir, repoDir, doltBin, profilePath, commit)
8887
})

go/store/blobstore/oci.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ func uploadParts(ctx context.Context, objectName, uploadID string, numParts, con
327327
for {
328328
if batchSize >= maxBatchSize {
329329
for _, u := range batch {
330-
u := u
331330
eg.Go(func() error {
332331
cp, err := uploadF(egCtx, objectName, uploadID, u.partNum, int64(len(u.b)), bytes.NewReader(u.b))
333332
if err != nil {
@@ -364,7 +363,6 @@ func uploadParts(ctx context.Context, objectName, uploadID string, numParts, con
364363

365364
if batchSize > 0 && len(batch) > 0 {
366365
for _, u := range batch {
367-
u := u
368366
eg.Go(func() error {
369367
cp, err := uploadF(egCtx, objectName, uploadID, u.partNum, int64(len(u.b)), bytes.NewReader(u.b))
370368
if err != nil {

go/store/nbs/mem_table.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ func (mt *memTable) addGetChildRefs(getAddrs chunks.GetAddrsCb) {
119119

120120
func (mt *memTable) addChildRefs(addrs hash.HashSet) {
121121
for h := range addrs {
122-
h := h
123122
mt.pendingRefs = append(mt.pendingRefs, hasRecord{
124123
a: &h,
125124
prefix: h.Prefix(),

go/store/nbs/store.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,6 @@ func toGetRecords(hashes hash.HashSet) []getRecord {
10471047
reqs := make([]getRecord, len(hashes))
10481048
idx := 0
10491049
for h := range hashes {
1050-
h := h
10511050
reqs[idx] = getRecord{
10521051
a: &h,
10531052
prefix: h.Prefix(),
@@ -1272,7 +1271,6 @@ func toHasRecords(hashes hash.HashSet) []hasRecord {
12721271
reqs := make([]hasRecord, len(hashes))
12731272
idx := 0
12741273
for h := range hashes {
1275-
h := h
12761274
reqs[idx] = hasRecord{
12771275
a: &h,
12781276
prefix: h.Prefix(),

0 commit comments

Comments
 (0)