diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2017-07-18 03:10:49 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2017-07-18 03:14:33 +0900 |
commit | bbe10f4f7745000c121b629ff68e81bba5a497f6 (patch) | |
tree | f166d6e6d649763db438407ddc7a749d237df11e /src/cache_test.go | |
parent | 5e72709613b816531c1e0aed6a710257e08bb5d8 (diff) |
Consolidate Result and rank structs
By not storing item index twice, we can cut down the size of Result
struct and now it makes more sense to store and pass Results by values.
Benchmarks show no degradation of performance by additional pointer
indirection for looking up index.
Diffstat (limited to 'src/cache_test.go')
-rw-r--r-- | src/cache_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cache_test.go b/src/cache_test.go index 54f3fb06..8a2d2cff 100644 --- a/src/cache_test.go +++ b/src/cache_test.go @@ -7,8 +7,8 @@ func TestChunkCache(t *testing.T) { chunk2 := make(Chunk, chunkSize) chunk1p := &Chunk{} chunk2p := &chunk2 - items1 := []*Result{&Result{}} - items2 := []*Result{&Result{}, &Result{}} + items1 := []Result{Result{}} + items2 := []Result{Result{}, Result{}} cache.Add(chunk1p, "foo", items1) cache.Add(chunk2p, "foo", items1) cache.Add(chunk2p, "bar", items2) |