MCPcopy Create free account
hub / github.com/KDE/kdevelop / normalizeLineEndings

Method normalizeLineEndings

kdevplatform/util/kdevstringhandler.cpp:278–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278void KDevelop::normalizeLineEndings(QByteArray& text)
279{
280 for (int i = 0, s = text.size(); i < s; ++i) {
281 if (text[i] != '\r') {
282 continue;
283 }
284 if (i + 1 < s && text[i + 1] == '\n') {
285 text.remove(i, 1);
286 s -= 1;
287 } else {
288 text[i] = '\n';
289 }
290 }
291}

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected