[Groonga-commit] groonga/grnxx [master] Initialize an array in initializer lists.

Back to archive index

susumu.yata null+****@clear*****
Thu Dec 6 13:52:54 JST 2012


susumu.yata	2012-12-06 13:52:54 +0900 (Thu, 06 Dec 2012)

  New Revision: 684a907de32e43dab17c614e6870ff22b09723e3
  https://github.com/groonga/grnxx/commit/684a907de32e43dab17c614e6870ff22b09723e3

  Log:
    Initialize an array in initializer lists.

  Modified files:
    lib/string.hpp

  Modified: lib/string.hpp (+1 -3)
===================================================================
--- lib/string.hpp    2012-12-06 13:48:33 +0900 (dece798)
+++ lib/string.hpp    2012-12-06 13:52:54 +0900 (29a2d6c)
@@ -63,9 +63,7 @@ class StringImpl {
   volatile uint32_t reference_count_;
   char buf_[1];
 
-  StringImpl() : length_(0), reference_count_(1), buf_() {
-    buf_[0] = '\0';
-  }
+  StringImpl() : length_(0), reference_count_(1), buf_{'\0'} {}
 
   static size_t buf_offset() {
     return static_cast<StringImpl *>(nullptr)->buf_
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index