From 36ba43d6ea38062b17f7e63ef659962bfc51c64d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 6 Jun 2017 23:34:34 +0300 Subject: Fix clang-tidy check readability-implicit-bool-cast. --- src/gui/fonts/textchunklist.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/gui/fonts/textchunklist.cpp') diff --git a/src/gui/fonts/textchunklist.cpp b/src/gui/fonts/textchunklist.cpp index df791f5f9..4ce39406b 100644 --- a/src/gui/fonts/textchunklist.cpp +++ b/src/gui/fonts/textchunklist.cpp @@ -36,10 +36,10 @@ TextChunkList::TextChunkList() : void TextChunkList::insertFirst(TextChunk *restrict const item) { TextChunk *restrict const oldFirst = start; - if (start) + if (start != nullptr) start->prev = item; item->prev = nullptr; - if (oldFirst) + if (oldFirst != nullptr) item->next = oldFirst; else end = item; @@ -55,15 +55,15 @@ void TextChunkList::moveToFirst(TextChunk *restrict const item) return; TextChunk *restrict const oldPrev = item->prev; - if (oldPrev) + if (oldPrev != nullptr) oldPrev->next = item->next; TextChunk *restrict const oldNext = item->next; - if (oldNext) + if (oldNext != nullptr) oldNext->prev = item->prev; else end = oldPrev; TextChunk *restrict const oldFirst = start; - if (start) + if (start != nullptr) start->prev = item; item->prev = nullptr; item->next = oldFirst; @@ -72,16 +72,16 @@ void TextChunkList::moveToFirst(TextChunk *restrict const item) void TextChunkList::remove(const TextChunk *restrict const item) { - if (!item) + if (item == nullptr) return; TextChunk *restrict const oldPrev = item->prev; TextChunk *restrict const oldNext = item->next; - if (oldPrev) + if (oldPrev != nullptr) oldPrev->next = item->next; else start = oldNext; - if (oldNext) + if (oldNext != nullptr) oldNext->prev = item->prev; else end = oldPrev; @@ -95,10 +95,10 @@ void TextChunkList::remove(const TextChunk *restrict const item) void TextChunkList::removeBack() { TextChunk *restrict oldEnd = end; - if (oldEnd) + if (oldEnd != nullptr) { end = oldEnd->prev; - if (end) + if (end != nullptr) end->next = nullptr; else start = nullptr; @@ -113,7 +113,7 @@ void TextChunkList::removeBack() void TextChunkList::removeBack(int n) { TextChunk *restrict item = end; - while (n && item) + while ((n != 0) && (item != nullptr)) { n --; TextChunk *oldEnd = item; @@ -124,7 +124,7 @@ void TextChunkList::removeBack(int n) delete oldEnd; size --; } - if (item) + if (item != nullptr) { item->next = nullptr; end = item; @@ -141,7 +141,7 @@ void TextChunkList::clear() search.clear(); searchWidth.clear(); TextChunk *restrict item = start; - while (item) + while (item != nullptr) { TextChunk *restrict const item2 = item->next; delete item; -- cgit v1.2.3-70-g09d2