use a nullable pointer to store the output of strSplitInPlace

This commit is contained in:
Folkert 2022-03-30 17:32:24 +02:00
parent fd209f90ff
commit d49ee97216
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -491,8 +491,12 @@ fn strFromFloatHelp(comptime T: type, float: T) RocStr {
}
// Str.split
pub fn strSplitInPlaceC(array: [*]RocStr, string: RocStr, delimiter: RocStr) callconv(.C) void {
return @call(.{ .modifier = always_inline }, strSplitInPlace, .{ array, string, delimiter });
pub fn strSplitInPlaceC(opt_array: ?[*]RocStr, string: RocStr, delimiter: RocStr) callconv(.C) void {
if (opt_array) |array| {
return @call(.{ .modifier = always_inline }, strSplitInPlace, .{ array, string, delimiter });
} else {
return;
}
}
fn strSplitInPlace(array: [*]RocStr, string: RocStr, delimiter: RocStr) void {