This commit is contained in:
gingerBill
2021-04-20 10:34:41 +01:00
parent ba9f0dd553
commit e9b1d4f633
3 changed files with 10 additions and 17 deletions
+2 -4
View File
@@ -27,10 +27,8 @@ when ODIN_DEFAULT_TO_NIL_ALLOCATOR || ODIN_OS == "freestanding" {
}
@(private)
byte_slice :: #force_inline proc "contextless" (data: rawptr, len: int) -> (res: []byte) {
r := (^Raw_Slice)(&res);
r.data, r.len = data, len;
return;
byte_slice :: #force_inline proc "contextless" (data: rawptr, len: int) -> []byte {
return transmute([]u8)Raw_Slice{data=data, len=max(len, 0)};
}