Remove pointer indirection by changing Chunk definition

This commit is contained in:
Junegunn Choi committed 2017-07-16 23:34:32 +09:00
1 parent 7b5ccc45bc
commit d4f3d5a164
7 files changed
+29 -23

No files matched your search

+2 -2
View File
@@ -281,8 +281,8 @@ func (p *Pattern) matchChunk(chunk *Chunk, space []*Result, slab *util.Slab) []*
matches := []*Result{}
if space == nil {
for _, item := range *chunk {
if match, _, _ := p.MatchItem(item, false, slab); match != nil {
for idx := range *chunk {
if match, _, _ := p.MatchItem(&(*chunk)[idx], false, slab); match != nil {
matches = append(matches, match)
}
}