[Patch] Simplify a bit __copy_streambufs

Paolo Carlini pcarlini@unitus.it
Thu Apr 24 21:37:00 GMT 2003


Hi,

this all started with this simplification of the main 'if':

  if (__in_avail != 0 && __sbin->_M_in_cur
      && __sbin->_M_in_cur + __in_avail <= __sbin->_M_in_end)  

to

  if (__in_avail
      && __sbin->_M_in_end - __sbin->_M_in_cur >= __in_avail)

then, I noticed that basic_streambuf::showmanyc() just returns 0,
(and the overall structure of __copy_streambufs doesn't make
advantage of a possible non-trivial showmanyc() like that we
have for basic_filebuf) therefore __in_avail (i.e., in_avail())
its just _M_in_end - _M_in_cur. But, then, why call in_avail()
in the first place?
The other bits are trivial (nice ;) clean ups.

Tested x86-linux. Ok?

Paolo.

//////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_copy
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030424/e6ab7880/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_copy
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030424/e6ab7880/attachment-0001.ksh>


More information about the Libstdc++ mailing list