Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor code simplification/refactoring

  • Loading branch information...
commit c4d3b3c55c4ed02d558838eead265f6fe79ce5d9 1 parent 55c95d4
@yrashk authored
Showing with 5 additions and 8 deletions.
  1. +5 −8 lib/condition.ex
View
13 lib/condition.ex
@@ -24,15 +24,12 @@ end
defrecord ExQL.Condition, op: nil, exprs: [] do
use ExQL.Op, [:<, :<=, :>=, :>, :==, :and, :or]
-
- def to_string(type, condition) do
- delim = to_binary(op(condition))
- [[_, first]|rest] = lc value inlist exprs(condition), do: [delim, ExQL.Expression.join(value, type, delim)]
- ["(",[first|rest],")"]
- end
-
end
defimpl ExQL.Expression, for: ExQL.Condition do
- def join(condition, type, _delim), do: ExQL.Condition.to_string(type, condition)
+ def join(condition, type, _delim) do
+ delim = to_binary(ExQL.Condition.op(condition))
+ [[_, first]|rest] = lc value inlist ExQL.Condition.exprs(condition), do: [delim, ExQL.Expression.join(value, type, delim)]
+ ["(",[first|rest],")"]
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.