Flip conditional

This commit is contained in:
Jarred Sumner
2024-07-07 09:47:30 -07:00
parent 37ee951448
commit 150ae032e8

View File

@@ -37,7 +37,7 @@ pub fn decode(destination: []u8, source: []const u8) bun.simdutf.SIMDUTFResult {
pub fn decodeAlloc(allocator: std.mem.Allocator, input: []const u8) ![]u8 {
var dest = try allocator.alloc(u8, decodeLen(input));
const result = decode(dest, input);
if (result.isSuccessful()) {
if (!result.isSuccessful()) {
allocator.free(dest);
return error.DecodingFailed;
}