File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ pub const Decoder = struct {
191191 const Value = std .meta .FieldType (DecodedType .KV , .value );
192192 var map = DecodedType .init (allocator );
193193 const map_len = field .size ;
194- try map .ensureTotalCapacity (@intCast ( map_len ) );
194+ try map .ensureTotalCapacity (map_len );
195195
196196 for (0.. map_len ) | _ | {
197197 const key = try self .decodeValue (allocator , Key );
@@ -209,8 +209,9 @@ pub const Decoder = struct {
209209 }
210210
211211 const Value = std .meta .Child (DecodedType .Slice );
212- var array = std .ArrayList (Value ).init (allocator );
213212 const array_len = field .size ;
213+ var array = try std .ArrayList (Value ).initCapacity (allocator , array_len );
214+
214215 for (0.. array_len ) | _ | {
215216 const value = try self .decodeValue (allocator , Value );
216217 try array .append (value );
Original file line number Diff line number Diff line change 1717}
1818
1919fn expectEqualMaps (
20- map : std .hash_map . StringHashMap ([]const u8 ),
20+ map : std .StringArrayHashMap ([]const u8 ),
2121 keys : []const []const u8 ,
2222 values : []const []const u8 ,
2323) ! void {
You can’t perform that action at this time.
0 commit comments