From 45af55c0fc387bc07f3ae3bed987035a589ccb10 Mon Sep 17 00:00:00 2001 From: zhufenggood Date: Fri, 15 Apr 2016 06:17:50 +0800 Subject: Update to_sql.rb Update to_sql.rb. Slightly performance improvement. --- lib/arel/visitors/to_sql.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index cab0ab7eca..f2a3d5aa0c 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -349,13 +349,13 @@ module Arel end if o.orders.any? - collector << ' ' if o.partitions.any? + collector << SPACE if o.partitions.any? collector << "ORDER BY " collector = inject_join o.orders, collector, ", " end if o.framing - collector << ' ' if o.partitions.any? or o.orders.any? + collector << SPACE if o.partitions.any? or o.orders.any? collector = visit o.framing, collector end @@ -564,7 +564,7 @@ module Arel collector = visit o.left, collector end if o.right.any? - collector << " " if o.left + collector << SPACE if o.left collector = inject_join o.right, collector, ' ' end collector -- cgit v1.2.3