This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] Small algorithmic tweak to locale::_Impl::_Impl
- From: Paolo Carlini <pcarlini at suse dot de>
- To: "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 28 Jun 2004 13:21:43 +0200
- Subject: [v3] Small algorithmic tweak to locale::_Impl::_Impl
Hi,
tested x86-linux, committed to mainline.
Paolo.
//////////////
2004-06-28 Paolo Carlini <pcarlini@suse.de>
* src/localename.cc (locale::_Impl::_Impl): Slightly improve
the algorithm used to name the categories.
diff -urN libstdc++-v3-orig/src/localename.cc libstdc++-v3/src/localename.cc
--- libstdc++-v3-orig/src/localename.cc 2004-05-23 01:46:34.000000000 +0200
+++ libstdc++-v3/src/localename.cc 2004-06-28 12:51:21.000000000 +0200
@@ -209,11 +209,11 @@
}
else
{
- const char* __beg = __s;
+ const char* __end = __s;
for (size_t __i = 0; __i < _S_categories_size; ++__i)
{
- __beg = std::strchr(__beg, '=') + 1;
- const char* __end = std::strchr(__beg, ';');
+ const char* __beg = std::strchr(__end + 1, '=') + 1;
+ __end = std::strchr(__beg, ';');
if (!__end)
__end = __s + __len;
_M_names[__i] = new char[__end - __beg + 1];