modernize: Use 'while(true)' instead of 'while(1)'
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 9 Sep 2018 22:04:49 +0000 (00:04 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
src/client/messagemodel.cpp
src/qtui/chatviewsearchcontroller.cpp

index 8eae52b..d817bab 100644 (file)
@@ -349,7 +349,7 @@ int MessageModel::indexForId(MsgId id)
 
     // binary search
     int start = 0; int end = messageCount() - 1;
 
     // binary search
     int start = 0; int end = messageCount() - 1;
-    while (1) {
+    while (true) {
         if (end - start == 1)
             return end;
         int pivot = (end + start) / 2;
         if (end - start == 1)
             return end;
         int pivot = (end + start) / 2;
index 2360913..e5026cd 100644 (file)
@@ -145,7 +145,7 @@ void ChatViewSearchController::updateHighlights(bool reuse)
                 int start = 0; int end = _highlightItems.count() - 1;
                 QPointF startPos;
                 QPointF endPos;
                 int start = 0; int end = _highlightItems.count() - 1;
                 QPointF startPos;
                 QPointF endPos;
-                while (1) {
+                while (true) {
                     startPos = _highlightItems[start]->scenePos();
                     endPos = _highlightItems[end]->scenePos();
                     if (startPos == oldHighlightPos) {
                     startPos = _highlightItems[start]->scenePos();
                     endPos = _highlightItems[end]->scenePos();
                     if (startPos == oldHighlightPos) {