mirror of https://github.com/Llewellynvdm/fzf.git
Remove duplicate code
This commit is contained in:
parent
7444eff6d4
commit
8061a2f108
|
@ -209,11 +209,10 @@ func parseTerms(fuzzy bool, caseMode Case, normalize bool, str string) []termSet
|
||||||
// Flip exactness
|
// Flip exactness
|
||||||
if fuzzy && !inv {
|
if fuzzy && !inv {
|
||||||
typ = termExact
|
typ = termExact
|
||||||
text = text[1:]
|
|
||||||
} else {
|
} else {
|
||||||
typ = termFuzzy
|
typ = termFuzzy
|
||||||
text = text[1:]
|
|
||||||
}
|
}
|
||||||
|
text = text[1:]
|
||||||
} else if strings.HasPrefix(text, "^") {
|
} else if strings.HasPrefix(text, "^") {
|
||||||
if typ == termSuffix {
|
if typ == termSuffix {
|
||||||
typ = termEqual
|
typ = termEqual
|
||||||
|
|
|
@ -236,17 +236,15 @@ func parseGetParams(query string) getParams {
|
||||||
for _, pair := range strings.Split(query, "&") {
|
for _, pair := range strings.Split(query, "&") {
|
||||||
parts := strings.SplitN(pair, "=", 2)
|
parts := strings.SplitN(pair, "=", 2)
|
||||||
if len(parts) == 2 {
|
if len(parts) == 2 {
|
||||||
|
val, err := strconv.Atoi(parts[1])
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
switch parts[0] {
|
switch parts[0] {
|
||||||
case "limit":
|
case "limit":
|
||||||
val, err := strconv.Atoi(parts[1])
|
params.limit = val
|
||||||
if err == nil {
|
|
||||||
params.limit = val
|
|
||||||
}
|
|
||||||
case "offset":
|
case "offset":
|
||||||
val, err := strconv.Atoi(parts[1])
|
params.offset = val
|
||||||
if err == nil {
|
|
||||||
params.offset = val
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue