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, RFA] Small clean-up to copyfmt


Hi,

I was studying how we are implementing the detailed requirements in the
standard and noticed these bits, redundant, therefore confusing: we are
already dealing with _M_word != _M_local_word three lines above and, if
I'm not wrong, nothing can change _M_word in the middle.

Tested x86-linux, will wait 24 hours in case I'm missing something.

Paolo.

//////////////
2004-08-21  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/basic_ios.tcc (basic_ios<>::copyfmt): Don't deal
	with _M_word != _M_local_word two times, redundantly.
diff -urN libstdc++-v3-orig/include/bits/basic_ios.tcc libstdc++-v3/include/bits/basic_ios.tcc
--- libstdc++-v3-orig/include/bits/basic_ios.tcc	2004-02-09 10:02:51.000000000 +0100
+++ libstdc++-v3/include/bits/basic_ios.tcc	2004-08-09 19:10:11.000000000 +0200
@@ -87,11 +87,6 @@
 	  _M_callbacks = __cb;
 	  for (int __i = 0; __i < __rhs._M_word_size; ++__i)
 	    __words[__i] = __rhs._M_word[__i];
-	  if (_M_word != _M_local_word)
-	    {
-	      delete [] _M_word;
-	      _M_word = 0;
-	    }
 	  _M_word = __words;
 	  _M_word_size = __rhs._M_word_size;
 

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