23
23
24
24
#include " log.h"
25
25
26
+ #include < QtGlobal>
26
27
#include < QString>
27
- #include < cassert >
28
+ #include < algorithm >
28
29
#include < limits>
29
30
#include < utility>
30
31
@@ -295,7 +296,7 @@ void LogFilteredData::handleSearchProgressed( int nbMatches, int progress, qint6
295
296
<< nbMatches << " progress=" << progress;
296
297
297
298
// searchDone_ = true;
298
- assert ( nbMatches >= 0 );
299
+ Q_ASSERT ( nbMatches >= 0 );
299
300
300
301
size_t start_index = matching_lines_.size ();
301
302
@@ -520,7 +521,7 @@ void LogFilteredData::insertMatchesIntoFilteredItemsCache( size_t start_index )
520
521
using std::end;
521
522
using std::next;
522
523
523
- assert ( start_index <= matching_lines_.size () );
524
+ Q_ASSERT ( start_index <= matching_lines_.size () );
524
525
525
526
if ( visibility_ != MarksAndMatches ) {
526
527
// this is invalidated and will be regenerated when we need it
@@ -529,7 +530,7 @@ void LogFilteredData::insertMatchesIntoFilteredItemsCache( size_t start_index )
529
530
return ;
530
531
}
531
532
532
- assert ( start_index <= filteredItemsCache_.size () );
533
+ Q_ASSERT ( start_index <= filteredItemsCache_.size () );
533
534
534
535
filteredItemsCache_.reserve ( matching_lines_.size () + marks_.size () );
535
536
// (it's an overestimate but probably not by much so it's fine)
@@ -542,7 +543,7 @@ void LogFilteredData::insertMatchesIntoFilteredItemsCache( size_t start_index )
542
543
if ( filteredIt == end ( filteredItemsCache_ ) || filteredIt->lineNumber () > matchesIt->lineNumber () ) {
543
544
filteredIt = filteredItemsCache_.emplace ( filteredIt, matchesIt->lineNumber (), Match );
544
545
} else {
545
- assert ( filteredIt->lineNumber () == matchesIt->lineNumber () );
546
+ Q_ASSERT ( filteredIt->lineNumber () == matchesIt->lineNumber () );
546
547
filteredIt->add ( Match );
547
548
}
548
549
}
0 commit comments