Skip to content

Unused char_count in src/detail/utf8.cpp #473

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

Closed
anarthal opened this issue Apr 4, 2025 · 0 comments
Closed

Unused char_count in src/detail/utf8.cpp #473

anarthal opened this issue Apr 4, 2025 · 0 comments

Comments

@anarthal
Copy link
Contributor

anarthal commented Apr 4, 2025

In these lines:

process/src/detail/utf8.cpp

Lines 208 to 225 in e637f84

std::size_t size_as_wide(const char * in, std::size_t size, error_code &)
{
const auto from = in;
const auto from_end = from + size;
const char * from_next = from;
std::size_t char_count = 0u;
while (from_next < from_end)
{
++char_count;
unsigned int octet_count = get_octet_count(*from_next);
// The buffer may represent incomplete characters, so terminate early if one is found
if (octet_count > static_cast<std::size_t>(from_end - from_next))
break;
from_next += octet_count;
}
return from_next - from;
}

char_count doesn't seem to be used anyhow. Compilers complain about it.

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