diff options
author | jtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-11-05 15:59:05 +0000 |
---|---|---|
committer | jtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-11-05 15:59:05 +0000 |
commit | cf59d114bea42ea9524cc23f5cc70bc881e701e3 (patch) | |
tree | 0c233bbefb1057d49dde1d241a171245bd6d8554 | |
parent | 0be9a1a67bf6e2c151015e46ca147f5b8ce0bd44 (diff) | |
download | ATCD-cf59d114bea42ea9524cc23f5cc70bc881e701e3.tar.gz |
ChangeLogTag: Fri Nov 5 07:52:51 2004 J.T. Conklin <jtc@acorntoolworks.com>
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | ace/ACE.cpp | 12 |
2 files changed, 15 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog index baf831fcb2c..eb262e852ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Fri Nov 5 07:52:51 2004 J.T. Conklin <jtc@acorntoolworks.com> + + * ace/ACE.cpp: + + Changed gcd() from recursive to iterative implementation. + A good optimizing compiler should be able to convert the + tail call to a jump; but some compilers aren't good, and + sometimes ACE is compiled without optimization. + Fri Nov 5 15:36:12 UTC 2004 Martin Corino <mcorino@remedy.nl> * bin/MakeProjectCreator/templates/gnu.mpd: diff --git a/ace/ACE.cpp b/ace/ACE.cpp index 8ef9a2e7e7d..e7a1d0ece26 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -3022,14 +3022,14 @@ ACE::map_errno (int error) u_long ACE::gcd (u_long x, u_long y) { - if (y == 0) + while (y != 0) { - return x; - } - else - { - return ACE::gcd (y, x % y); + u_long r = x % y; + x = y; + y = r; } + + return x; } |