diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 080f55a21b73..3e928ef598bd 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2003-12-02 Paolo Carlini + + * config/locale/gnu/monetary_members.cc + (money_base::_S_construct_pattern): For case 3: and 4: + exchanging 'if (__precedes)' and 'if (__space)' allows + to factor out a few more assignments. + 2003-12-01 Benjamin Kosnik * include/bits/basic_ios.h (basic_ios::setstate): Revert. diff --git a/libstdc++-v3/config/locale/gnu/monetary_members.cc b/libstdc++-v3/config/locale/gnu/monetary_members.cc index e39d7f97797a..580297b6325f 100644 --- a/libstdc++-v3/config/locale/gnu/monetary_members.cc +++ b/libstdc++-v3/config/locale/gnu/monetary_members.cc @@ -132,78 +132,70 @@ namespace std break; case 3: // 3 The sign immediately precedes the symbol. - if (__space) + if (__precedes) { - // Have space. - if (__precedes) + __ret.field[0] = sign; + __ret.field[1] = symbol; + if (__space) { - __ret.field[0] = sign; - __ret.field[1] = symbol; __ret.field[2] = space; __ret.field[3] = value; } else { - __ret.field[0] = value; + __ret.field[2] = value; + __ret.field[3] = none; + } + } + else + { + __ret.field[0] = value; + if (__space) + { __ret.field[1] = space; __ret.field[2] = sign; __ret.field[3] = symbol; } - } - else - { - // Have none. - if (__precedes) - { - __ret.field[0] = sign; - __ret.field[1] = symbol; - __ret.field[2] = value; - } else { - __ret.field[0] = value; __ret.field[1] = sign; __ret.field[2] = symbol; + __ret.field[3] = none; } - __ret.field[3] = none; } break; case 4: - // 4 The sign immediately follows the symbol. - if (__space) + // 4 The sign immediately follows the symbol. + if (__precedes) { - // Have space. - if (__precedes) + __ret.field[0] = symbol; + __ret.field[1] = sign; + if (__space) { - __ret.field[0] = symbol; - __ret.field[1] = sign; __ret.field[2] = space; __ret.field[3] = value; } else { - __ret.field[0] = value; - __ret.field[1] = space; - __ret.field[2] = symbol; - __ret.field[3] = sign; + __ret.field[2] = value; + __ret.field[3] = none; } } else { - // Have none. - if (__precedes) + __ret.field[0] = value; + if (__space) { - __ret.field[0] = symbol; - __ret.field[1] = sign; - __ret.field[2] = value; + __ret.field[1] = space; + __ret.field[2] = symbol; + __ret.field[3] = sign; } else { - __ret.field[0] = value; __ret.field[1] = symbol; __ret.field[2] = sign; + __ret.field[3] = none; } - __ret.field[3] = none; } break; default: