MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / sort

Method sort

src/Sorter.cpp:21–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19#include "Sorter.h"
20
21void CaseInsensitiveSorter::sort(QVector<QByteArrayView> &lines) const
22{
23 std::stable_sort(lines.begin(), lines.end(),
24 [dir = direction](const QByteArrayView &a, const QByteArrayView &b) {
25 int result = a.compare(b, Qt::CaseInsensitive);
26 return dir == Direction::Ascending ? (result < 0) : (result > 0);
27 });
28}
29
30void CaseSensitiveSorter::sort(QVector<QByteArrayView> &lines) const
31{

Callers 1

MainWindowMethod · 0.45

Calls 2

endMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected