Skip to content

Instantly share code, notes, and snippets.

@MasterDuke17
Created April 6, 2017 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MasterDuke17/73b3709e16c807a7dcda174e528a64e6 to your computer and use it in GitHub Desktop.
Save MasterDuke17/73b3709e16c807a7dcda174e528a64e6 to your computer and use it in GitHub Desktop.
diff --git a/src/strings/ops.c b/src/strings/ops.c
index 76015bff..b0ad843f 100644
--- a/src/strings/ops.c
+++ b/src/strings/ops.c
@@ -71,10 +71,14 @@ static MVMString * collapse_strands(MVMThreadContext *tc, MVMString *orig) {
MVM_string_gi_init(tc, &gi, orig);
for (i = 0; i < ographs; i++) {
- MVMGrapheme32 g = MVM_string_gi_get_grapheme(tc, &gi);
- if (g < -127 || g > 127)
+ result->body.storage.blob_32[i] = MVM_string_gi_get_grapheme(tc, &gi);
+ }
+
+ for (i = 0; i < ographs; i++) {
+ if (result->body.storage.blob_32[i] < -127 || result->body.storage.blob_32[i] > 127) {
can_use_8bit = 0;
- result->body.storage.blob_32[i] = g;
+ break;
+ }
}
if (can_use_8bit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment