From c5e8cb25caa39ed018ede5270e1566e8f7448396 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 30 Oct 2017 11:57:24 -0500 Subject: simplify things (#7735) --- model/search_params.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'model/search_params.go') diff --git a/model/search_params.go b/model/search_params.go index 070ac6d24..2feea8da1 100644 --- a/model/search_params.go +++ b/model/search_params.go @@ -31,16 +31,6 @@ func (o *SearchParams) ToJson() string { var searchFlags = [...]string{"from", "channel", "in"} -func splitWordsNoQuotes(text string) []string { - words := []string{} - - for _, word := range strings.Fields(text) { - words = append(words, word) - } - - return words -} - func splitWords(text string) []string { words := []string{} @@ -55,14 +45,14 @@ func splitWords(text string) []string { foundQuote = false location = i + 1 } else { - words = append(words, splitWordsNoQuotes(text[location:i])...) + words = append(words, strings.Fields(text[location:i])...) foundQuote = true location = i } } } - words = append(words, splitWordsNoQuotes(text[location:])...) + words = append(words, strings.Fields(text[location:])...) return words } -- cgit v1.2.3-1-g7c22