mllg / checkmate

Fast and versatile argument checks
https://mllg.github.io/checkmate/
Other
261 stars 30 forks source link

possibly add sorted = FALSE to ls() calls to increase performance #260

Closed srfall closed 5 months ago

srfall commented 5 months ago

Checkmate contains some calls to ls(), mostly in the form of wf(contains %nin% ls(x, all.names = TRUE)) e.g: https://github.com/mllg/checkmate/blob/HEAD/R/checkEnvironment.R#L27

From my understanding, within these calls the order doesn't matter and one could improve the performance by adding sorted = FALSE as an argument (at least thats what I gathered from https://stat.ethz.ch/R-manual/R-devel/library/base/html/ls.html).

srfall commented 5 months ago

Ok, nevermind seems like there was a reason to do it this way: https://github.com/mllg/checkmate/commit/409793c2dfda8f2ac125e53cd4a232913d0faf35