Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Complete methods of Character about code points in char sequences.#5034

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gzm0 merged 1 commit intoscala-js:mainfromsjrd:jl-character-more-methods
Sep 17, 2024

Conversation

sjrd
Copy link
Member

Implement all overloads ofjava.lang.Character.:

  • codePointAt
  • codePointBefore
  • codePointCount
  • offsetByCodePoints

In the process, unify with the implementations of methods of the same name injl.String.

This completes the set of methods ofjl.Character that do not need the Unicode database.

Fixes#5010, among other things.

if (index == limit - 1)
a(index).toInt // the only case where `limit` makes a difference
else
codePointAtImpl(CharSequence.ofArray(a), index)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Wouldn't callingcodePointAt(a, index) be pretty much equally fast, but less code?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ah yes, that's a good observation.

Copy link
MemberAuthor

@sjrdsjrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I won't have a computer until Monday evening, so I'll update then.

if (index == limit - 1)
a(index).toInt // the only case where `limit` makes a difference
else
codePointAtImpl(CharSequence.ofArray(a), index)
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ah yes, that's a good observation.

Implement all overloads of `java.lang.Character.`:* `codePointAt`* `codePointBefore`* `codePointCount`* `offsetByCodePoints`In the process, unify with the implementations of methods of thesame name in `jl.String`.This completes the set of methods of `jl.Character` that do notneed the Unicode database.Fixesscala-js#5010, among other things.
@sjrdsjrdforce-pushed thejl-character-more-methods branch from1176359 toe10803cCompareSeptember 16, 2024 19:36
@sjrdsjrd requested a review fromgzm0September 16, 2024 19:37
@gzm0gzm0 merged commit1ff5f96 intoscala-js:mainSep 17, 2024
3 checks passed
@sjrdsjrd deleted the jl-character-more-methods branchSeptember 17, 2024 15:48
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gzm0gzm0gzm0 approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

java.lang.Character.codePointAt(java.lang.CharSequence,int)int
2 participants
@sjrd@gzm0

[8]ページ先頭

©2009-2025 Movatter.jp