tidyverse / lubridate

Make working with dates in R just that little bit easier
https://lubridate.tidyverse.org
GNU General Public License v3.0
724 stars 207 forks source link

Consider a first_exists() approach for finding the tz directory? #1137

Open MichaelChirico opened 10 months ago

MichaelChirico commented 10 months ago

https://github.com/tidyverse/lubridate/blob/e54b612c0672c57bb9cea12dd2482b0d59b3aa64/R/tzdir.R#L55-L61

Happened to notice this helper has a lot of overlap with lintr:::find_config().

Recently tested that looping over the potential locations & returning the first found is much faster than checking all of them:

https://github.com/r-lib/lintr/issues/2204

Would that be preferable here as well?

vspinu commented 10 months ago

Indeed, it does not make sense to check all of them.