mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 00:28:42 +00:00
anchor regexp
Anchoring this regexp (i.e., making it start with a "^") reduces the time it takes to load the first CP plot from 10 seconds to 6.5 seconds on Sean's three years of rides. Unbelievable, but repeatable.
This commit is contained in:
@@ -201,7 +201,7 @@ done:
|
||||
|
||||
QDate
|
||||
cpi_filename_to_date(const QString filename) {
|
||||
QRegExp rx(".*(\\d\\d\\d\\d)_(\\d\\d)_(\\d\\d)_\\d\\d_\\d\\d_\\d\\d\\.cpi$");
|
||||
QRegExp rx("^(\\d\\d\\d\\d)_(\\d\\d)_(\\d\\d)_\\d\\d_\\d\\d_\\d\\d\\.cpi$");
|
||||
if (rx.exactMatch(filename)) {
|
||||
assert(rx.numCaptures() == 3);
|
||||
QDate date = QDate(rx.cap(1).toInt(),
|
||||
|
||||
Reference in New Issue
Block a user