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
This commit is contained in:
Vincent Ambo 2020-05-20 22:27:37 +01:00
parent d331d3a0b5
commit 689ef502f5
78 changed files with 863 additions and 792 deletions

View file

@ -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();