Preallocate space when unfolding headers
ClosedPublic

Authored by dvratil on Oct 11 2017, 1:57 PM.

Details

Summary

Unfolding headers skips the line-break and indentation characters
so the result will be at worst the same size as the original header.
Since unfolding is implemented as appending characters one by one to
the result bytearray, we can pre-allocate the destination field at
the beginning of the loop.

Diff Detail

Repository
R180 PIM: KMime
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dvratil created this revision.Oct 11 2017, 1:57 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptOct 11 2017, 1:57 PM
Restricted Application added a subscriber: KDE PIM. · View Herald Transcript

For me it seems logic as optimization.
But I keep volker validates or not it :)

vkrause accepted this revision.Oct 13 2017, 8:57 AM
This revision is now accepted and ready to land.Oct 13 2017, 8:57 AM
This revision was automatically updated to reflect the committed changes.