From 4bf5a1a0c4b50228aad45dc845838642c99f5864 Mon Sep 17 00:00:00 2001 From: Victor Marmol Date: Sat, 26 Jul 2014 13:26:24 -0700 Subject: [PATCH] Fix some UI todos. --- pages/containers.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pages/containers.go b/pages/containers.go index 279b80b9..8f4b95f2 100644 --- a/pages/containers.go +++ b/pages/containers.go @@ -19,6 +19,7 @@ import ( "fmt" "html/template" "log" + "math" "net/http" "net/url" "path" @@ -131,10 +132,6 @@ func getActiveCores(mask string) map[int]bool { } func printCores(millicores *uint64) string { - // TODO(vmarmol): Detect this correctly - if *millicores > 1024*1000 { - return "unlimited" - } cores := float64(*millicores) / 1000 return strconv.FormatFloat(cores, 'f', 3, 64) } @@ -148,8 +145,7 @@ func toMegabytes(bytes uint64) float64 { } func printMegabytes(bytes uint64) string { - // TODO(vmarmol): Detect this correctly - if bytes > (100 << 30) { + if bytes >= math.MaxInt64 { return "unlimited" } megabytes := toMegabytes(bytes)