Created
January 2, 2017 08:09
-
-
Save niner/711ce294403778bf0f01bcd51b3f5861 to your computer and use it in GitHub Desktop.
This file contains 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
diff --git a/src/strings/normalize.c b/src/strings/normalize.c | |
index 12514d0..3206668 100644 | |
--- a/src/strings/normalize.c | |
+++ b/src/strings/normalize.c | |
@@ -645,8 +645,12 @@ static void grapheme_composition(MVMThreadContext *tc, MVMNormalizer *n, MVMint3 | |
MVMint32 should_break_mode = 0; | |
while (pos < to) { | |
MVMint32 next_pos = pos + 1; | |
- should_break_mode = should_break(tc, n->buffer[pos], n->buffer[next_pos], should_break_mode); | |
- if (next_pos == to || should_break_mode > 0) { | |
+ MVMint32 do_break = next_pos == to; | |
+ if (! do_break) | |
+ do_break = ( | |
+ should_break_mode = should_break(tc, n->buffer[pos], n->buffer[next_pos], should_break_mode) | |
+ ) > 0; | |
+ if (do_break) { | |
/* Last in buffer or next code point is a non-starter; turn | |
* sequence into a synthetic. */ | |
MVMGrapheme32 g = MVM_nfg_codes_to_grapheme(tc, n->buffer + starterish, next_pos - starterish); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment