You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2006/05/05 21:51:37 UTC

svn commit: r400157 - /incubator/stdcxx/trunk/tests/src/21.strings.cpp

Author: sebor
Date: Fri May  5 12:51:35 2006
New Revision: 400157

URL: http://svn.apache.org/viewcvs?rev=400157&view=rev
Log:
2006-05-05  Martin Sebor  <se...@roguewave.com>

	* 21.strings.cpp (_rw_setvars): Used memset() instead of a loop
	to set string elements.

Modified:
    incubator/stdcxx/trunk/tests/src/21.strings.cpp

Modified: incubator/stdcxx/trunk/tests/src/21.strings.cpp
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/src/21.strings.cpp?rev=400157&r1=400156&r2=400157&view=diff
==============================================================================
--- incubator/stdcxx/trunk/tests/src/21.strings.cpp (original)
+++ incubator/stdcxx/trunk/tests/src/21.strings.cpp Fri May  5 12:51:35 2006
@@ -38,6 +38,7 @@
 #include <stdarg.h>       // for va_arg, ...
 #include <stddef.h>       // for size_t
 #include <stdlib.h>       // for free()
+#include <string.h>       // for memset()
 
 /**************************************************************************/
 
@@ -618,8 +619,8 @@
 
     if ('\0' == StringMembers::long_string [0]) {
         // initialize long_string
-        for (size_t i = 0; i != sizeof StringMembers::long_string - 1; ++i)
-            StringMembers::long_string [i] = 'x';
+        const size_t nchars = sizeof StringMembers::long_string - 1;
+        memset (StringMembers::long_string, 'x', nchars);
     }
 
     static const StringMembers::charT char_types[] = {