diff --git a/src/qtshit/write.zig b/src/qtshit/write.zig index 4ec4044..fbe3ff6 100644 --- a/src/qtshit/write.zig +++ b/src/qtshit/write.zig @@ -69,9 +69,9 @@ pub fn add_qvariant(writer: anytype, variant: qvar.QVariant) !void { pub fn add_qvariantmap(writer: anytype, map: std.StringHashMap(qvar.QVariant)) @TypeOf(writer).Error!void { var size: u32 = 0; - var iterator = map.iterator(); + var sizeIterator = map.iterator(); - while (iterator.next()) |entry| { + while (sizeIterator.next()) |entry| { size += try qvar.qvariant_size(.{ .string = entry.key }); size += try qvar.qvariant_size(entry.value); size += 4; @@ -82,7 +82,10 @@ pub fn add_qvariantmap(writer: anytype, map: std.StringHashMap(qvar.QVariant)) @ try add_byte(writer, 1); try add_int(writer, map.count()); - while (iterator.next()) |entry| { + var writeIterator = map.iterator(); + + + while (writeIterator.next()) |entry| { try add_string(writer, entry.key); try add_qvariant(writer, entry.value); }