Skip to content

Commit bac3cce

Browse files
committed
Credo is_? rant
1 parent d360a5a commit bac3cce

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/2017/day_18.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ defmodule AdventOfCode.Y2017.Day18 do
5252
s0 = %{s0 | queue: s0.queue ++ out1}
5353
new_sent_count = sent_count + length(out1)
5454

55-
if (out0 == [] and out1 == [] and is_deadlock(s0, s1, stat0, stat1)) or
55+
if (out0 == [] and out1 == [] and deadlock?(s0, s1, stat0, stat1)) or
5656
(stat0 == :halted and stat1 == :halted) do
5757
new_sent_count
5858
else
5959
simulate(s0, s1, new_sent_count)
6060
end
6161
end
6262

63-
defp is_deadlock(s0, s1, stat0, stat1) do
63+
defp deadlock?(s0, s1, stat0, stat1) do
6464
(stat0 == :blocked and s0.queue == [] and (stat1 == :blocked and s1.queue == [])) or
6565
(stat0 == :halted and stat1 == :blocked and s1.queue == []) or
6666
(stat1 == :halted and stat0 == :blocked and s0.queue == [])

0 commit comments

Comments
 (0)