diff options
author | Ivan Krasin <imkrasin@gmail.com> | 2012-03-30 21:34:13 +0000 |
---|---|---|
committer | Ivan Krasin <imkrasin@gmail.com> | 2012-03-30 21:34:13 +0000 |
commit | 63065370ef5f25916704c83bd50c092968f68d53 (patch) | |
tree | eac9c37fa27e24529820ad17b17d4b3b087e0146 | |
parent | e6b19e29cb859745913923715496c841ea27b8a4 (diff) | |
download | gcd-63065370ef5f25916704c83bd50c092968f68d53.tar.gz |
Use the power of Go for loop
-rw-r--r-- | gcd.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 } |