From 80bf90c03408392c436fa06d7188dfe33c4d3e73 Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Mon, 18 Dec 2017 14:05:00 +0100 Subject: [PATCH] Slight performance improvement. Only need to check whether the current program is blocked, since the other will have switched if it was going to block. --- 2017/day-18/solution.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2017/day-18/solution.lua b/2017/day-18/solution.lua index 8ee8b90..b239524 100755 --- a/2017/day-18/solution.lua +++ b/2017/day-18/solution.lua @@ -117,7 +117,7 @@ end while true do instr = instructions[iptr[pid]] - if waiting[0] and waiting[1] then + if waiting[pid] then print("Deadlocked!") break end