summaryrefslogtreecommitdiff
path: root/src/util/util.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-08-14 11:58:47 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-08-14 11:58:47 +0900
commit41e916a511f37848168a3cddf7cbd1ea1a9ba8da (patch)
tree78356cdb62c711fd1a2f84cedec5bd306efdff64 /src/util/util.go
parentd9c8a9a880dd9fc28c9fb466bd1c81cd6a8a159c (diff)
downloadfzf-41e916a511f37848168a3cddf7cbd1ea1a9ba8da.tar.gz
[perf] evaluateBonus can start from sidx - 1
Diffstat (limited to 'src/util/util.go')
-rw-r--r--src/util/util.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/util/util.go b/src/util/util.go
index a95340e7..113fee91 100644
--- a/src/util/util.go
+++ b/src/util/util.go
@@ -10,14 +10,11 @@ import (
)
// Max returns the largest integer
-func Max(first int, items ...int) int {
- max := first
- for _, item := range items {
- if item > max {
- max = item
- }
+func Max(first int, second int) int {
+ if first >= second {
+ return first
}
- return max
+ return second
}
// Min returns the smallest integer