2
0
mirror of https://github.com/miguelmota/cointop synced 2024-11-05 00:00:14 +00:00

Remove hasPrefix

This commit is contained in:
Vuong 2021-10-26 08:23:32 +00:00 committed by GitHub
parent 6ef43d5ba0
commit f26006823b

View File

@ -93,26 +93,20 @@ func (ct *Cointop) Search(q string) error {
ct.State.lastSearchQuery = q
}
hasPrefix := false
canSearchSymbol := true
canSearchName := true
if strings.HasPrefix(q, "s:") {
canSearchSymbol = true
canSearchName = false
hasPrefix = true
q = q[2:]
log.Debug("Search, by keyword")
}
if strings.HasPrefix(q, "n:") {
canSearchSymbol = false
canSearchName = true
hasPrefix = true
log.Debug("Search, by name")
}
if hasPrefix {
q = q[2:]
log.Debugf("Search, truncated query '%s'", q)
log.Debug("Search, by name")
}
idx := -1