Skip to content

Commit dd050c0

Browse files
authored
Fix String::__boot when smart strings are disabled (#1192)
1 parent aa01cc6 commit dd050c0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/String.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,6 +2376,7 @@ void String::__boot()
23762376
{
23772377
#ifdef HX_SMART_STRINGS
23782378
if (c>127)
2379+
#endif
23792380
{
23802381
char16_t buf[20];
23812382
buf[0] = c;
@@ -2386,8 +2387,8 @@ void String::__boot()
23862387
sConstStrings[c].__w = w;
23872388
fixHashPerm16(sConstStrings[c]);
23882389
}
2390+
#ifdef HX_SMART_STRINGS
23892391
else
2390-
#endif
23912392
{
23922393
char buf[20];
23932394
int utf8Len = UTF8Bytes(c);
@@ -2397,6 +2398,7 @@ void String::__boot()
23972398
sConstStrings[c].__s = (char *)InternalCreateConstBuffer(buf,utf8Len+1,true);
23982399
sConstStrings[c].length = utf8Len;
23992400
}
2401+
#endif
24002402
}
24012403

24022404
sConstEmptyString.mPtr = new (hx::NewObjConst)StringData(emptyString);
@@ -2405,8 +2407,3 @@ void String::__boot()
24052407
&CreateEmptyString, &CreateString, 0, 0, 0
24062408
);
24072409
}
2408-
2409-
2410-
2411-
2412-

0 commit comments

Comments
 (0)