mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 20:39:05 +00:00
fix(s3): handle empty MetadataMap in dupeImpl correctly
Remove incorrect error.OutOfMemory return for empty maps. Zero-length allocations are valid in Zig and the existing code handles them properly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -82,7 +82,6 @@ pub const MetadataMap = struct {
|
||||
|
||||
fn dupeImpl(this: @This(), allocator: std.mem.Allocator) error{OutOfMemory}!MetadataMap {
|
||||
const n = this.keys.len;
|
||||
if (n == 0) return error.OutOfMemory;
|
||||
|
||||
const new_keys = try allocator.alloc([]const u8, n);
|
||||
errdefer allocator.free(new_keys);
|
||||
|
||||
Reference in New Issue
Block a user