1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +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]
public this(StringView strView)
{
let tryBufferSize = strView.Length - sizeof(char8*);
let bufferSize = (tryBufferSize >= 0) ? tryBufferSize : 0;
let count = strView.Length;
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
#unwarn
char8* addlPtr = append char8[bufferSize]*(?);
Init(bufferSize);