Created
April 26, 2020 09:57
-
-
Save Tarmil/daff5a300c2b1b9b63d6a6569f732d8f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Avalonia.Media.TextFormatting.Unicode | |
open Avalonia.Utility | |
[<Struct; IsByRefLike>] | |
type CodepointEnumerator(text: ReadOnlySlice<char>) = | |
let mutable text = text | |
let mutable current = Codepoint.ReplacementCodepoint | |
member _.Current = current | |
member _.MoveNext() = | |
if text.IsEmpty then | |
current <- Codepoint.ReplacementCodepoint | |
false | |
else | |
let current', count = Codepoint.ReadAt(text, 0) | |
current <- current' | |
text <- text.Skip(count) | |
true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment