aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/allegro/bigcache/utils.go
blob: ca1df79b933551515ea8dc7cf0f3db06b81b7442 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package bigcache

func max(a, b int) int {
    if a > b {
        return a
    }
    return b
}

func convertMBToBytes(value int) int {
    return value * 1024 * 1024
}

func isPowerOfTwo(number int) bool {
    return (number & (number - 1)) == 0
}