Skip to content

Commit 8f72ea8

Browse files
committed
use new variable
1 parent 6c5c083 commit 8f72ea8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/ex_unit/lib/ex_unit/diff.ex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,8 @@ defmodule ExUnit.Diff do
377377
{parsed_left, improper_left, operators_left, length_left} =
378378
split_left_list(left, 0, env.context)
379379

380-
{parsed_right, improper_right} =
381-
if improper_left != [] do
382-
split_right_list(right, length_left, [])
383-
else
384-
split_right_list(right, -1, [])
385-
end
380+
element_limit = if improper_left == [], do: -1, else: length_left
381+
{parsed_right, improper_right} = split_right_list(right, element_limit, [])
386382

387383
{parsed_diff, parsed_post_env} = myers_difference_list(parsed_left, parsed_right, env)
388384

0 commit comments

Comments
 (0)