summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Krasin <imkrasin@gmail.com>2012-03-30 21:34:13 +0000
committerIvan Krasin <imkrasin@gmail.com>2012-03-30 21:34:13 +0000
commit63065370ef5f25916704c83bd50c092968f68d53 (patch)
treeeac9c37fa27e24529820ad17b17d4b3b087e0146
parente6b19e29cb859745913923715496c841ea27b8a4 (diff)
downloadgcd-63065370ef5f25916704c83bd50c092968f68d53.tar.gz
Use the power of Go for loop
-rw-r--r--gcd.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcd.go b/gcd.go
index 21e5371..fbd8c6a 100644
--- a/gcd.go
+++ b/gcd.go
@@ -38,8 +38,8 @@ func gcd2(a, b uint64) uint64 {
}
func gcdn(ns []uint64) (r uint64) {
- for i := range ns {
- r = gcd2(r, ns[i])
+ for _, v := range ns {
+ r = gcd2(r, v)
}
return
}