1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-15 14:54:09 +02:00

Fixed String(StringView) ctor

This commit is contained in:
Brian Fiete 2022-08-04 08:46:43 -07:00
parent 05c2e1587c
commit dfd443d68b

View file

@ -210,8 +210,8 @@ namespace System
[AllowAppend] [AllowAppend]
public this(StringView strView) public this(StringView strView)
{ {
let tryBufferSize = strView.Length - sizeof(char8*); let count = strView.Length;
let bufferSize = (tryBufferSize >= 0) ? tryBufferSize : 0; int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
#unwarn #unwarn
char8* addlPtr = append char8[bufferSize]*(?); char8* addlPtr = append char8[bufferSize]*(?);
Init(bufferSize); Init(bufferSize);