Minor
authorChristopher Dunn <cdunn2001@gmail.com>
Tue, 20 Oct 2015 04:49:07 +0000 (23:49 -0500)
committerChristopher Dunn <cdunn2001@gmail.com>
Tue, 20 Oct 2015 04:49:07 +0000 (23:49 -0500)
adjustments, based on comments in PR.

src/lib_json/json_value.cpp

index 9f56c74..91b5f23 100644 (file)
@@ -218,8 +218,7 @@ void Value::CommentInfo::setComment(const char* text, size_t len) {
 Value::CZString::CZString(ArrayIndex aindex) : cstr_(0), index_(aindex) {}
 
 Value::CZString::CZString(char const* str, unsigned ulength, DuplicationPolicy allocate)
-    : cstr_(str)
-{
+    : cstr_(str) {
   // allocate != duplicate
   storage_.policy_ = allocate & 0x3;
   storage_.length_ = ulength & 0x3FFFFFFF;
@@ -228,8 +227,7 @@ Value::CZString::CZString(char const* str, unsigned ulength, DuplicationPolicy a
 Value::CZString::CZString(const CZString& other)
     : cstr_(other.storage_.policy_ != noDuplication && other.cstr_ != 0
                 ? duplicateStringValue(other.cstr_, other.storage_.length_)
-                : other.cstr_)
-{
+                : other.cstr_) {
   storage_.policy_ = (other.cstr_
                  ? (static_cast<DuplicationPolicy>(other.storage_.policy_) == noDuplication
                      ? noDuplication : duplicate)
@@ -239,10 +237,8 @@ Value::CZString::CZString(const CZString& other)
 
 #if JSON_HAS_RVALUE_REFERENCES
 Value::CZString::CZString(CZString&& other)
-  : cstr_(other.cstr_),
-  index_(other.index_)
-{
-  other.cstr_ = 0;
+  : cstr_(other.cstr_), index_(other.index_) {
+  other.cstr_ = nullptr;
 }
 #endif
 
@@ -436,10 +432,9 @@ Value::Value(Value const& other)
 
 #if JSON_HAS_RVALUE_REFERENCES
 // Move constructor
-Value::Value(Value&& other)
-{
-       initBasic(nullValue);
-       swap(other);
+Value::Value(Value&& other) {
+  initBasic(nullValue);
+  swap(other);
 }
 #endif