mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Edit User metric warning if use sample() function
.. its much faster to vectorize and use the samples() function in init
or value function when working with user metrics.
for example this code:
sample {
work <- work + (POWER * recIntSecs);
}
value { work; }
count { Duration; }
should be refactored to:
value {
work <- sum(samples(power) * recIntSecs);
}
count { Duration; }
This commit is contained in:
@@ -2725,6 +2725,8 @@ DataFilterEdit::checkErrors()
|
||||
QStringList errors = checker.check(toPlainText());
|
||||
checker.colorSyntax(document(), textCursor().position()); // syntax + error highlighting
|
||||
|
||||
if (checker.rt.functions.contains("sample")) errors << tr("Warning: sample() is slow -- update code to use samples()");
|
||||
|
||||
// even if no errors need to tell folks
|
||||
emit syntaxErrors(errors);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user