This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch] Fix libstdc++/13341 (speed-up <wchar_t>::do_narrow/widen)


Paolo Carlini writes:
 >     wchar_t
 >     ctype<wchar_t>::
 >     do_widen(char __c) const
 > !   { 
 > !     wchar_t __ret;
 > !     const unsigned char __uc = static_cast<unsigned char>(__c);
 > !     if (__uc < 128)
 > !       __ret = _M_widen[__uc];
 > !     else
 > !       __ret = btowc(__uc);
 > !     return __ret;
 > !   }

Why not cache all 256 widen chars rather than just 128?  We already
know all the source possibilities, unlike in do_narrow().

Jerry Quinn


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]