locale_init.cc (locale::_Impl::_Impl(size_t)): Use new-initializer instead of loop.
authorJonathan Wakely <jwakely@redhat.com>
Sat, 29 Nov 2014 22:58:38 +0000 (22:58 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Sat, 29 Nov 2014 22:58:38 +0000 (22:58 +0000)
* src/c++98/locale_init.cc (locale::_Impl::_Impl(size_t)): Use
new-initializer instead of loop.
* src/c++98/localename.cc (locale::_Impl::_Impl(const char*, size_t)):
Likewise.

From-SVN: r218184

libstdc++-v3/ChangeLog
libstdc++-v3/src/c++98/locale_init.cc
libstdc++-v3/src/c++98/localename.cc

index 5781709284d6cceeb2aa6bf303088a93cf77ca54..ac4d4a43f7755fe22ad61641a811aea028240819 100644 (file)
@@ -4,6 +4,11 @@
        typedef.
        (time_get): Likewise. Fix comments.
 
+       * src/c++98/locale_init.cc (locale::_Impl::_Impl(size_t)): Use
+       new-initializer instead of loop.
+       * src/c++98/localename.cc (locale::_Impl::_Impl(const char*, size_t)):
+       Likewise.
+
 2014-11-26  Jonathan Wakely  <jwakely@redhat.com>
            Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
index 2c6dfc53ec583ca7b87abf90f9eaa7d1d2457a1f..c007648d37ba718ae5318729390ed76d6f01d8da 100644 (file)
@@ -375,17 +375,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   : _M_refcount(__refs), _M_facets(0), _M_facets_size(_GLIBCXX_NUM_FACETS),
   _M_caches(0), _M_names(0)    
   {
-    _M_facets = new (&facet_vec) const facet*[_M_facets_size];
-    _M_caches = new (&cache_vec) const facet*[_M_facets_size];
-    for (size_t __i = 0; __i < _M_facets_size; ++__i)
-      _M_facets[__i] = _M_caches[__i] = 0;
+    _M_facets = new (&facet_vec) const facet*[_M_facets_size]();
+    _M_caches = new (&cache_vec) const facet*[_M_facets_size]();
 
     // Name the categories.
-    _M_names = new (&name_vec) char*[_S_categories_size];
+    _M_names = new (&name_vec) char*[_S_categories_size]();
     _M_names[0] = new (&name_c[0]) char[2];
     std::memcpy(_M_names[0], locale::facet::_S_get_c_name(), 2);
-    for (size_t __j = 1; __j < _S_categories_size; ++__j)
-      _M_names[__j] = 0;
 
     // This is needed as presently the C++ version of "C" locales
     // != data in the underlying locale model for __timepunct,
index e93c846e78449d5478ed9a04247ac84a1cb4f142..589f8c6617d124106c06b70e4764117f743d831e 100644 (file)
@@ -184,15 +184,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
     __try
       {
-       _M_facets = new const facet*[_M_facets_size];
-       for (size_t __i = 0; __i < _M_facets_size; ++__i)
-         _M_facets[__i] = 0;
-       _M_caches = new const facet*[_M_facets_size];
-       for (size_t __j = 0; __j < _M_facets_size; ++__j)
-         _M_caches[__j] = 0;
-       _M_names = new char*[_S_categories_size];
-       for (size_t __k = 0; __k < _S_categories_size; ++__k)
-         _M_names[__k] = 0;
+       _M_facets = new const facet*[_M_facets_size]();
+       _M_caches = new const facet*[_M_facets_size]();
+       _M_names = new char*[_S_categories_size]();
 
        // Name the categories.
        const char* __smon = __s;