Skip to content

Commit cc302f3

Browse files
committed
Favor Q_ASSERT() to assert()
1 parent 0e73a3d commit cc302f3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/data/logfiltereddata.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323

2424
#include "log.h"
2525

26+
#include <QtGlobal>
2627
#include <QString>
27-
#include <cassert>
28+
#include <algorithm>
2829
#include <limits>
2930
#include <utility>
3031

@@ -295,7 +296,7 @@ void LogFilteredData::handleSearchProgressed( int nbMatches, int progress, qint6
295296
<< nbMatches << " progress=" << progress;
296297

297298
// searchDone_ = true;
298-
assert( nbMatches >= 0 );
299+
Q_ASSERT( nbMatches >= 0 );
299300

300301
size_t start_index = matching_lines_.size();
301302

@@ -520,7 +521,7 @@ void LogFilteredData::insertMatchesIntoFilteredItemsCache( size_t start_index )
520521
using std::end;
521522
using std::next;
522523

523-
assert( start_index <= matching_lines_.size() );
524+
Q_ASSERT( start_index <= matching_lines_.size() );
524525

525526
if ( visibility_ != MarksAndMatches ) {
526527
// this is invalidated and will be regenerated when we need it
@@ -529,7 +530,7 @@ void LogFilteredData::insertMatchesIntoFilteredItemsCache( size_t start_index )
529530
return;
530531
}
531532

532-
assert( start_index <= filteredItemsCache_.size() );
533+
Q_ASSERT( start_index <= filteredItemsCache_.size() );
533534

534535
filteredItemsCache_.reserve( matching_lines_.size() + marks_.size() );
535536
// (it's an overestimate but probably not by much so it's fine)
@@ -542,7 +543,7 @@ void LogFilteredData::insertMatchesIntoFilteredItemsCache( size_t start_index )
542543
if ( filteredIt == end( filteredItemsCache_ ) || filteredIt->lineNumber() > matchesIt->lineNumber() ) {
543544
filteredIt = filteredItemsCache_.emplace( filteredIt, matchesIt->lineNumber(), Match );
544545
} else {
545-
assert( filteredIt->lineNumber() == matchesIt->lineNumber() );
546+
Q_ASSERT( filteredIt->lineNumber() == matchesIt->lineNumber() );
546547
filteredIt->add( Match );
547548
}
548549
}

0 commit comments

Comments
 (0)