Optimize KMime::CRLFtoLF() and LFtoCRLF() optimal cases
QByteArray::indexOf() is way cheaper than QByteArray::replace() and does not cause detach. This hugely optimizes the ideal case when the data passed to KMime::CRLFtoLF() already use \n instead of \r\n (basically all mails written by KMime), because it does not trigger deep copy. In the bad case when we actually need to do the replace the added cost of indexOf() is negligable compared to replace(), especially because indexOf() will return after scanning only single line of the data until running to the first \r\n (in most cases, anyway, and that's what we are optimizing for). REVIEW: 124967
parent
d14dde77
Please register or sign in to comment