Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit f7d9976

Browse files
committed
Minimize diff
1 parent b19028c commit f7d9976

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

cointop/search.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,16 @@ func (ct *Cointop) Search(q string) error {
107107
coin := ct.State.allCoins[i]
108108
name := strings.ToLower(coin.Name)
109109
symbol := strings.ToLower(coin.Symbol)
110-
// if query matches name or symbol, return immediately
111-
if name == q || symbol == q {
110+
// if query matches symbol, return immediately
111+
if symbol == q {
112+
ct.GoToGlobalIndex(i)
113+
return nil
114+
}
115+
// if query matches name, return immediately
116+
if name == q {
112117
ct.GoToGlobalIndex(i)
113118
return nil
114119
}
115-
116120
// store index with the smallest levenshtein
117121
dist := levenshtein.DamerauLevenshteinDistance(name, q)
118122
if min == -1 || dist <= min {

0 commit comments

Comments
 (0)