From 527965cbde667e46413a9bd3decd9853cbe2697d Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Mon, 19 Oct 2015 23:49:07 -0500 Subject: [PATCH] Minor adjustments, based on comments in PR. --- src/lib_json/json_value.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index 9f56c74..91b5f23 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp @@ -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(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