From 8750bb69a0be60137300c2c3450a01466fd3f4b3 Mon Sep 17 00:00:00 2001 From: Preetam Jinka Date: Thu, 22 Feb 2018 14:01:22 -0500 Subject: [PATCH] fix cache https://github.com/Preetam/lm2/issues/47 --- lm2.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lm2.go b/lm2.go index 4bca1e6..c8c0df3 100644 --- a/lm2.go +++ b/lm2.go @@ -167,7 +167,7 @@ func (c *Collection) readRecord(offset int64) (*record, error) { } c.stats.incRecordsRead(1) c.stats.incCacheMisses(1) - + c.cache.push(rec) return rec, nil } @@ -183,9 +183,6 @@ func (c *Collection) nextRecord(rec *record, level int) (*record, error) { if err != nil { return nil, err } - if level >= 2 { - c.cache.push(rec) - } return nextRec, nil }