diff options
Diffstat (limited to 'third_party/nix/src/libutil/json.cc')
-rw-r--r-- | third_party/nix/src/libutil/json.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/third_party/nix/src/libutil/json.cc b/third_party/nix/src/libutil/json.cc index c5f52ae8ef3f..218fc264ba50 100644 --- a/third_party/nix/src/libutil/json.cc +++ b/third_party/nix/src/libutil/json.cc @@ -27,7 +27,7 @@ void toJSON(std::ostream& str, const char* start, const char* end) { } void toJSON(std::ostream& str, const char* s) { - if (!s) { + if (s == nullptr) { str << "null"; } else { toJSON(str, s, s + strlen(s)); @@ -91,7 +91,7 @@ JSONWriter::JSONWriter(std::ostream& str, bool indent) JSONWriter::JSONWriter(JSONState* state) : state(state) { state->stack++; } JSONWriter::~JSONWriter() { - if (state) { + if (state != nullptr) { assertActive(); state->stack--; if (state->stack == 0) { @@ -150,7 +150,7 @@ void JSONObject::open() { } JSONObject::~JSONObject() { - if (state) { + if (state != nullptr) { state->depth--; if (state->indent && !first) { indent(); |