Skip to content

Commit

Permalink
Fix Kubernetes strategy (bitwalker#17)
Browse files Browse the repository at this point in the history
* Fix intersection.
* Fix difference
  • Loading branch information
frekw authored and bitwalker committed May 30, 2017
1 parent 4e3f5c7 commit 944bdab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/strategy/strategy.ex
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ defmodule Cluster.Strategy do
end
end

def intersection(a, []), do: a
def intersection([], b), do: b
def intersection(_a, []), do: []
def intersection([], _b), do: []
def intersection(a, b) when is_list(a) and is_list(b) do
a |> MapSet.new |> MapSet.intersection(MapSet.new(b))
end

def difference(a, []), do: a
def difference([], b), do: b
def difference(a, []), do: a
def difference([], _b), do: []
def difference(a, b) when is_list(a) and is_list(b) do
a |> MapSet.new |> MapSet.difference(MapSet.new(b))
end
Expand Down

0 comments on commit 944bdab

Please sign in to comment.