Remove pointer indirection by changing Chunk definition

This commit is contained in:
Junegunn Choi
2017-07-15 12:28:29 +09:00
parent 7b5ccc45bc
commit d4f3d5a164
7 changed files with 29 additions and 23 deletions

View File

@@ -65,7 +65,7 @@ func (mg *Merger) Get(idx int) *Result {
idx = mg.count - idx - 1
}
chunk := (*mg.chunks)[idx/chunkSize]
return &Result{item: (*chunk)[idx%chunkSize]}
return &Result{item: &(*chunk)[idx%chunkSize]}
}
if mg.sorted {