From f26006823baddca387a25b38bffe0d8a9725f8e9 Mon Sep 17 00:00:00 2001 From: Vuong <3168632+vuon9@users.noreply.github.com> Date: Tue, 26 Oct 2021 08:23:32 +0000 Subject: [PATCH] Remove hasPrefix --- cointop/search.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/cointop/search.go b/cointop/search.go index 94dbd99..cc3f7c4 100644 --- a/cointop/search.go +++ b/cointop/search.go @@ -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