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

Function removeConsecutiveDuplicates

src/ByteArrayUtils.h:102–109  ·  view source on GitHub ↗

Remove only *consecutive* duplicates. Example: A A B B B C A → A B C A

Source from the content-addressed store, hash-verified

100// Remove only *consecutive* duplicates.
101// Example: A A B B B C A → A B C A
102inline void removeConsecutiveDuplicates(QList<QByteArrayView>& parts)
103{
104 auto newEnd = std::unique(parts.begin(), parts.end(), [](const QByteArrayView& a, const QByteArrayView& b) {
105 return a == b;
106 });
107
108 parts.erase(newEnd, parts.end());
109}
110
111
112inline QByteArray join(const QList<QByteArrayView>& parts, const QByteArray& delimiter)

Callers 1

Calls 1

endMethod · 0.80

Tested by

no test coverage detected