diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-20T21·27+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-20T21·27+0100 |
commit | 689ef502f5b0655c9923ed77da2ae3504630f473 (patch) | |
tree | 3e331c153646f136875f047cc3b9f0aad8c86341 /third_party/nix/src/libutil/json.cc | |
parent | d331d3a0b5c497a46e2636f308234be66566c04c (diff) |
refactor(3p/nix): Apply clang-tidy's readability-* fixes r/788
This applies the readability fixes listed here: https://clang.llvm.org/extra/clang-tidy/checks/list.html
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(); |