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

Using is_ascii_string to check encoding #5867

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

S-H-GAMELINKS
Copy link
Contributor

Some code has this code to check encoding is ascii.

rb_enc_str_coderange(result) != ENC_CODERANGE_7BIT

But, already implemented is_ascii_string function that check ascii encoding in internal/string.h.

static inline bool
is_ascii_string(VALUE str)
{
    return rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT;
}

I thought better to these check code replace and using is_ascii_string function.

And, #5554 add build dependence but that was unneeded.
So, I recreate pull request.

@S-H-GAMELINKS S-H-GAMELINKS force-pushed the using_is_ascii_string_func branch 8 times, most recently from 7794200 to 5dadce2 Compare May 9, 2022 12:02
@S-H-GAMELINKS S-H-GAMELINKS force-pushed the using_is_ascii_string_func branch 4 times, most recently from f691429 to b9c0f7a Compare May 15, 2022 19:39
@S-H-GAMELINKS S-H-GAMELINKS force-pushed the using_is_ascii_string_func branch 2 times, most recently from e1f46f9 to c015f52 Compare May 23, 2022 12:59
@nobu nobu merged commit 420f3ce into ruby:master Jun 17, 2022
@S-H-GAMELINKS S-H-GAMELINKS deleted the using_is_ascii_string_func branch June 17, 2022 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants