Created
April 26, 2020 17:16
-
-
Save Tarmil/f65265c2e928dbf184c926ee917a6033 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 = | |
val mutable text : ReadOnlySlice<char> | |
val mutable current : Codepoint | |
new(text) = | |
{ text = text; current = Codepoint.ReplacementCodepoint } | |
member this.Current = this.current | |
member this.MoveNext() = | |
if this.text.IsEmpty then | |
this.current <- Codepoint.ReplacementCodepoint | |
false | |
else | |
let current, count = Codepoint.ReadAt(this.text, 0) | |
this.current <- current | |
this.text <- this.text.Skip(count) | |
true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment