Skip to content

Commit

Permalink
cache.go: a list of 1 element is also easily deduped by doing nothing.
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Seymour <jon@wildducktheories.com>
  • Loading branch information
jonseymour committed Feb 16, 2016
1 parent c5d97a6 commit 9a0b270
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tsdb/engine/tsm1/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (e *entry) add(values []Value) {
// deduplicate sorts and orders the entry's values. If values are already deduped and
// and sorted, the function does no work and simply returns.
func (e *entry) deduplicate() {
if !e.needSort || len(e.values) == 0 {
if !e.needSort || len(e.values) < 2 {
return
}
e.values = e.values.Deduplicate()
Expand Down

0 comments on commit 9a0b270

Please sign in to comment.