Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of guess_max #33

Closed
chainsawriot opened this issue Jun 8, 2024 · 0 comments
Closed

Implementation of guess_max #33

chainsawriot opened this issue Jun 8, 2024 · 0 comments

Comments

@chainsawriot
Copy link
Collaborator

chainsawriot commented Jun 8, 2024

In many cases we don't need to go through the entire vector to guess the type, apropos readxl::read_excel(guess_max) and vroom::vroom(guess_max).

It seems that we can implement the same thing here

bool canParse(
const cpp11::strings& x, const canParseFun& canParse, LocaleInfo* pLocale) {
for (const auto & i : x) {
if (i == NA_STRING) {
continue;
}
if (i.size() == 0) {
continue;
}
if (!canParse(std::string(i), pLocale)) {
return false;
}
}
return true;
}

Instead of going through x entirely (for (const auto & i : x)), just go through a subset of the first guess_max items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant