This commit is contained in:
2022-02-20 09:47:47 +02:00
committed by Motiejus Jakštys
parent 9487194c95
commit e54c153dd8
2 changed files with 6 additions and 9 deletions

View File

@@ -61,7 +61,7 @@ pub const ShellWriter = struct {
};
var fullOffset: u12 = 0;
var idx: u6 = 0;
while (idx < shells.len) {
while (idx < shells.len) : (idx += 1) {
const len = @intCast(u6, shells.get(idx).len);
try self.blob.appendSlice(shells.get(idx));
const ourShell = self.blob.constSlice()[fullOffset .. fullOffset + len];
@@ -77,7 +77,6 @@ pub const ShellWriter = struct {
//const stderr = std.io.getStdErr().writer();
//stderr.print("\n", .{}) catch unreachable;
try self.blob.appendNTimes(0, padding);
idx += 1;
}
return self;
}
@@ -155,10 +154,9 @@ pub const ShellWriter = struct {
var topShells = try BoundedArray([]const u8, MaxShells).init(total);
var i: u32 = 0;
while (i < total) {
while (i < total) : (i += 1) {
const elem = deque.removeMax().shell;
topShells.set(i, elem);
i += 1;
}
const result = ShellSections.init(self.allocator, topShells);