aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/util.go
diff options
context:
space:
mode:
authorMichael Hudson-Doyle <michael.hudson@canonical.com>2015-04-22 12:41:14 +1200
committerIan Lance Taylor <iant@golang.org>2015-04-22 18:50:07 +0000
commitac1cdd13e04607abb862d508312c64180ad142da (patch)
treefad1a0604319ea4d29ae8df0799d682bf0a81e9b /src/cmd/internal/obj/util.go
parent677839353e013b13e0fb3d28e01a01a5ccf0c7a1 (diff)
downloadgo-ac1cdd13e04607abb862d508312c64180ad142da.tar.xz
cmd/5g, etc, cmd/internal/gc, cmd/internal/obj, etc: coalesce bool2int implementations
There were 10 implementations of the trivial bool2int function, 9 of which were the only thing in their file. Remove all of them in favor of one in cmd/internal/obj. Change-Id: I9c51d30716239df51186860b9842a5e9b27264d3 Reviewed-on: https://go-review.googlesource.com/9230 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/internal/obj/util.go')
-rw-r--r--src/cmd/internal/obj/util.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cmd/internal/obj/util.go b/src/cmd/internal/obj/util.go
index 189f9611ce..03e6ad9116 100644
--- a/src/cmd/internal/obj/util.go
+++ b/src/cmd/internal/obj/util.go
@@ -641,3 +641,10 @@ var Anames = []string{
"VARDEF",
"VARKILL",
}
+
+func Bool2int(b bool) int {
+ if b {
+ return 1
+ }
+ return 0
+}