Remove special nilItem

This commit is contained in:
Junegunn Choi
2017-08-15 01:10:41 +09:00
parent 2069bbc8b5
commit 0d171ba1d8
9 changed files with 49 additions and 51 deletions

View File

@@ -278,8 +278,8 @@ func (p *Pattern) matchChunk(chunk *Chunk, space []Result, slab *util.Slab) []Re
matches := []Result{}
if space == nil {
for idx := range *chunk {
if match, _, _ := p.MatchItem(&(*chunk)[idx], false, slab); match != nil {
for idx := 0; idx < chunk.count; idx++ {
if match, _, _ := p.MatchItem(&chunk.items[idx], false, slab); match != nil {
matches = append(matches, *match)
}
}