Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: perf/go/util/util.go

Issue 608273002: Add versioning to perf SQL database (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Incorporating feedback 4 Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « perf/go/trybot/trybot.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: perf/go/util/util.go
diff --git a/perf/go/util/util.go b/perf/go/util/util.go
index 24d350d8b15992625d3f54a1e3322aafee463e6c..04bb06885670125106b835051f0da414f06918f2 100644
--- a/perf/go/util/util.go
+++ b/perf/go/util/util.go
@@ -46,3 +46,23 @@ func MapsEqual(a, b map[string]string) bool {
}
return true
}
+
+// This is sad, but apparently there is no library function to get the absolute
+// value of an int.
+func AbsInt(v int) int {
+ if v < 0 {
+ return -v
+ }
+ return v
+}
+
+// Returns -1, 1 or 0 depending on the sign of v.
+func SignInt(v int) int {
+ if v < 0 {
+ return -1
+ }
+ if v > 0 {
+ return 1
+ }
+ return 0
+}
« no previous file with comments | « perf/go/trybot/trybot.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698