Skip to content

Commit 06cf74b

Browse files
authored
Apply suggestion from @josevalim
1 parent a1ec0b8 commit 06cf74b

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/ecto/query/planner.ex

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,7 @@ defmodule Ecto.Query.Planner do
136136
def query(query, operation, cache, adapter, counter, query_cache?) do
137137
{query, params, key} = plan(query, operation, adapter)
138138
{cast_params, dump_params} = Enum.unzip(params)
139-
140-
key =
141-
cond do
142-
not query_cache? -> :nocache
143-
counter != 0 -> {key, counter}
144-
true -> key
145-
end
146-
139+
key = if query_cache?, do: [key | counter], else: :nocache
147140
query_with_cache(key, query, operation, cache, adapter, counter, cast_params, dump_params)
148141
end
149142

0 commit comments

Comments
 (0)