From 689ef502f5b0655c9923ed77da2ae3504630f473 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 20 May 2020 22:27:37 +0100 Subject: refactor(3p/nix): Apply clang-tidy's readability-* fixes This applies the readability fixes listed here: https://clang.llvm.org/extra/clang-tidy/checks/list.html --- third_party/nix/src/libutil/json.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'third_party/nix/src/libutil/json.cc') 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(); -- cgit 1.4.1