From d4f3d5a16423fbf039644f04516c052d1654326c Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 15 Jul 2017 12:28:29 +0900 Subject: Remove pointer indirection by changing Chunk definition --- src/item.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/item.go') diff --git a/src/item.go b/src/item.go index c67ac7ab..955c31d8 100644 --- a/src/item.go +++ b/src/item.go @@ -19,6 +19,12 @@ func (item *Item) Index() int32 { return item.index } +var nilItem = Item{index: -1} + +func (item *Item) Nil() bool { + return item.index < 0 +} + func (item *Item) TrimLength() int32 { if item.trimLength >= 0 { return item.trimLength -- cgit v1.2.3