Skip to content

Commit 6897c9d

Browse files
committed
refactor: Directly swap two variables to optimize code
Signed-off-by: jingchanglu <[email protected]>
1 parent e77545f commit 6897c9d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

embedded/sql/file_sort.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ func (s *fileSorter) mergeAllChunks() (resultReader, error) {
153153
newChunks[len(chunks)/2] = lastChunk
154154
}
155155

156-
temp := currFile
157-
currFile = outFile
158-
outFile = temp
156+
currFile, outFile = outFile, currFile
159157

160158
_, err = outFile.Seek(0, io.SeekStart)
161159
if err != nil {

0 commit comments

Comments
 (0)