UT_UCS_strcpy_char instantiates a UT_Mbtowc class instance on each 
call.  As the default constructor uses values that should remain constant 
throughout the lifetime of the application, creating and destroying the 
UT_Mbtowc instance is unnecessary.  Especially in a function as frequently 
used as UT_USC_strcpy_char. Here is a patch to make the variable static 
(created only once).  Could someone review this and (hopefully) check it in?
Thanks,
Matti


Index: abi/src/af/util/xp/ut_string.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/util/xp/ut_string.cpp,v
retrieving revision 1.66
diff -c -r1.66 ut_string.cpp
*** abi/src/af/util/xp/ut_string.cpp    2001/08/10 18:32:38     1.66
--- abi/src/af/util/xp/ut_string.cpp    2001/09/22 18:30:32
***************
*** 692,698 ****
        unsigned char * s       = (unsigned char *) src;

   #ifndef WITHOUT_MB
!       UT_Mbtowc m;
        wchar_t wc;
   #endif

--- 692,698 ----
        unsigned char * s       = (unsigned char *) src;

   #ifndef WITHOUT_MB
!       static UT_Mbtowc m;
        wchar_t wc;
   #endif



Reply via email to