From 5866eb23217de4d29b181e30c26cee28ebc6aedc Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Thu, 26 Oct 2017 23:10:54 -0700 Subject: Code/repo search (#2582) Indexed search of repository contents (for default branch only) --- modules/util/util.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'modules/util/util.go') diff --git a/modules/util/util.go b/modules/util/util.go index 104c80f524..e99f951f21 100644 --- a/modules/util/util.go +++ b/modules/util/util.go @@ -38,3 +38,19 @@ func OptionalBoolOf(b bool) OptionalBool { } return OptionalBoolFalse } + +// Max max of two ints +func Max(a, b int) int { + if a < b { + return b + } + return a +} + +// Min min of two ints +func Min(a, b int) int { + if a > b { + return b + } + return a +} -- cgit v1.2.3