Simple optimization makes mh_mbox 3x faster
This commit is contained in:
parent
6a1dbea05b
commit
9cefcb7283
@ -448,9 +448,13 @@ bool MimeHandlerMbox::next_document()
|
|||||||
// the best
|
// the best
|
||||||
hademptyline = false;
|
hademptyline = false;
|
||||||
}
|
}
|
||||||
if (!regexec(&fromregex, line, 0, 0, 0) ||
|
/* The 'F' compare is redundant but it improves performance
|
||||||
|
A LOT */
|
||||||
|
if (line[0] == 'F' && (
|
||||||
|
!regexec(&fromregex, line, 0, 0, 0) ||
|
||||||
((m_quirks & MBOXQUIRK_TBIRD) &&
|
((m_quirks & MBOXQUIRK_TBIRD) &&
|
||||||
!regexec(&minifromregex, line, 0, 0, 0)) ) {
|
!regexec(&minifromregex, line, 0, 0, 0)))
|
||||||
|
) {
|
||||||
LOGDEB1(("MimeHandlerMbox: msgnum %d, "
|
LOGDEB1(("MimeHandlerMbox: msgnum %d, "
|
||||||
"From_ at line %d: [%s]\n", m_msgnum, m_lineno, line));
|
"From_ at line %d: [%s]\n", m_msgnum, m_lineno, line));
|
||||||
if (storeoffsets)
|
if (storeoffsets)
|
||||||
@ -562,7 +566,7 @@ int main(int argc, char **argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
config->setKeyDir(path_getfather(filename));
|
config->setKeyDir(path_getfather(filename));
|
||||||
MimeHandlerMbox mh("text/x-mail");
|
MimeHandlerMbox mh(config, "text/x-mail");
|
||||||
if (!mh.set_document_file(filename)) {
|
if (!mh.set_document_file(filename)) {
|
||||||
cerr << "set_document_file failed" << endl;
|
cerr << "set_document_file failed" << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user