[Patch] Update _M_replace_safe/_M_replace_aux
Paolo Carlini
pcarlini@suse.de
Wed Jan 21 21:16:00 GMT 2004
Hi,
this is a different kind of clean-up, also quite interesting ;)
Basically, I noticed that _M_replace_safe is called only with
third and fourth arguments either random access iterators
(_M_replace) or plain pointers. Second, I noticed that the
callers work in terms of size_types and pointers, not iterators.
Third, I noticed that internally _M_replace_safe computes
exactly quantities of the former types: this implies that every
time it's called (*very often*) we go through stupid conversions
from size_types and pointers to iterators and back.
Thus the below, which avoids a lot of redundant arithmetic for
append, assign, replace, insert, etc...
Once more, also a bug fixed: the check in _M_replace_safe for
length errors was incorrect (compare it to that in _M_replace_aux)
Tested x86-linux. As usual, will wait 12 hours or so.
Paolo.
///////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_string
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040121/759b0427/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_string
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040121/759b0427/attachment-0001.ksh>
More information about the Libstdc++
mailing list