chore: better conform to zig idioms

This commit is contained in:
2022-09-03 18:30:48 -03:00
parent 59669ba3a5
commit 3fb7f2f814
8 changed files with 55 additions and 71 deletions

View File

@@ -14,8 +14,8 @@ pub const Scheduler = struct {
tick: u64,
queue: PriorityQueue(Event, void, lessThan),
pub fn init(alloc: Allocator) Self {
var sched = Self{ .tick = 0, .queue = PriorityQueue(Event, void, lessThan).init(alloc, {}) };
pub fn init(allocator: Allocator) Self {
var sched = Self{ .tick = 0, .queue = PriorityQueue(Event, void, lessThan).init(allocator, {}) };
sched.queue.add(.{ .kind = .HeatDeath, .tick = std.math.maxInt(u64) }) catch unreachable;
return sched;