stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r400157 - /incubator/stdcxx/trunk/tests/src/21.strings.cpp
Date Fri, 05 May 2006 19:51:37 GMT
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  <sebor@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[] = {



Mime
View raw message