mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-31 20:33:50 -07:00
Simplify Item structure
This commit compensates for the performance overhead from the extended tiebreak option.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user