Skip to content

Possibly redundant checks by Graphemes::next #144

Open
@s9ferech

Description

@s9ferech

If you make just a small change to the Graphemes::next method then this breaks the tests in graphemes_test because the GraphemeCursor::next_boundary returns GraphemeIncomplete::PreContext(1). As far as I understand, this indicates that the cursor tries to look back at preceding grapheme clusters that it has already processed. I don't know if this behavior is intentional or required to process UTF-8 correctly, but it seems unnecessary because the tests do pass if you just use a fresh cursor instead and treat your current position as the start of the string. Some performance improvements might be possible if you do it that way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy