From 8d3a302a1754a4e28cc1085b95e9a03981372d02 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 13 Jan 2016 21:36:44 +0900 Subject: Simplify Item structure This commit compensates for the performance overhead from the extended tiebreak option. --- src/options.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/options.go') diff --git a/src/options.go b/src/options.go index 30e00160..6399343c 100644 --- a/src/options.go +++ b/src/options.go @@ -83,7 +83,6 @@ const ( byLength byBegin byEnd - byIndex ) func defaultMargin() [4]string { @@ -147,7 +146,7 @@ func defaultOptions() *Options { Delimiter: Delimiter{}, Sort: 1000, Tac: false, - Criteria: []criterion{byMatchLen, byLength, byIndex}, + Criteria: []criterion{byMatchLen, byLength}, Multi: false, Ansi: false, Mouse: true, @@ -382,7 +381,6 @@ func parseTiebreak(str string) []criterion { switch str { case "index": check(&hasIndex, "index") - criteria = append(criteria, byIndex) case "length": check(&hasLength, "length") criteria = append(criteria, byLength) @@ -396,9 +394,6 @@ func parseTiebreak(str string) []criterion { errorExit("invalid sort criterion: " + str) } } - if !hasIndex { - criteria = append(criteria, byIndex) - } return criteria } -- cgit v1.2.3