Skip to content
Myr

Remove duplicate code

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by onee-only · committed by Junegunn Choi · parent 7444eff · Browse files · 2 files+7 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+7 added−10 removed

  • other:+7 added−10 removed

2 files+7 added−10 removed

modified:src/pattern.go+1 added-2 removed
207 unmodified lines
208 if strings.HasPrefix(text, "'") {209 // Flip exactness210 if fuzzy && !inv {211 typ = termExact212 text = text[1:]212 } else {213 typ = termFuzzy215 text = text[1:]214 }215 text = text[1:]216 } else if strings.HasPrefix(text, "^") {217 if typ == termSuffix {218 typ = termEqual219 } else {
207 unmodified lines
modified:src/server.go+6 added-8 removed
234 unmodified lines
235 params := getParams{limit: 100, offset: 0}236 for _, pair := range strings.Split(query, "&") {237 parts := strings.SplitN(pair, "=", 2)238 if len(parts) == 2 {239 val, err := strconv.Atoi(parts[1])240 if err != nil {241 continue242 }243 switch parts[0] {244 case "limit":241 val, err := strconv.Atoi(parts[1])242 if err == nil {243 params.limit = val245 params.limit = val244 }246 case "offset":246 val, err := strconv.Atoi(parts[1])247 if err == nil {248 params.offset = val247 params.offset = val249 }248 }249 }250 }251 return params
1 unmodified line