MM-31062: Rewrite empty string checks to be more idiomatic (#16587)
https://mattermost.atlassian.net/browse/MM-31062 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1a131b54af
Коммит
6487d0ca91
@@ -214,7 +214,7 @@ func parseSearchFlags(input []string) ([]searchWord, []flag) {
|
||||
// and remove extra pound #s
|
||||
word = hashtagStart.ReplaceAllString(word, "#")
|
||||
|
||||
if len(word) != 0 {
|
||||
if word != "" {
|
||||
words = append(words, searchWord{
|
||||
word,
|
||||
exclude,
|
||||
@@ -345,9 +345,9 @@ func ParseSearchParams(text string, timeZoneOffset int) []*SearchParams {
|
||||
len(excludedPlainTerms) == 0 && len(excludedHashtagTerms) == 0 &&
|
||||
(len(inChannels) != 0 || len(fromUsers) != 0 ||
|
||||
len(excludedChannels) != 0 || len(excludedUsers) != 0 ||
|
||||
len(afterDate) != 0 || len(excludedAfterDate) != 0 ||
|
||||
len(beforeDate) != 0 || len(excludedBeforeDate) != 0 ||
|
||||
len(onDate) != 0 || len(excludedDate) != 0) {
|
||||
afterDate != "" || excludedAfterDate != "" ||
|
||||
beforeDate != "" || excludedBeforeDate != "" ||
|
||||
onDate != "" || excludedDate != "") {
|
||||
paramsList = append(paramsList, &SearchParams{
|
||||
Terms: "",
|
||||
ExcludedTerms: "",
|
||||
|
||||
Ссылка в новой задаче
Block a user