Skip to content

Commit da88f07

Browse files
committed
Pass model by reference instead of by value (eliminates copying 4KB on each call), hate this syntax tbh
1 parent 2eebc16 commit da88f07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gallop.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const Model = struct {
1515
const Self = @This();
1616

1717
pub fn init() Self { return Self { .ctx = 0, .data = .{Counter.init()}**(1<<12) }; }
18-
pub fn p(self: Self) u16 { return self.data[self.ctx].p(); }
18+
pub fn p(self: *Self) u16 { return self.data[self.ctx].p(); }
1919
pub fn update(self: *Self, bit: u1) void {
2020
self.data[self.ctx].update(bit);
2121
self.ctx <<= 1; self.ctx |= bit;

0 commit comments

Comments
 (0)