From 1445194dafe328d1c50b1e2c54046ea2ef55ab66 Mon Sep 17 00:00:00 2001 From: Davor Ocelic Date: Sun, 7 Jan 2018 16:45:07 +0100 Subject: [PATCH] Convert output string to StringBuilder --- src/text_to_sql_search.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/text_to_sql_search.cr b/src/text_to_sql_search.cr index 166b60b..7fc8745 100644 --- a/src/text_to_sql_search.cr +++ b/src/text_to_sql_search.cr @@ -65,7 +65,7 @@ module TextToSqlSearch tokens.reject! {|t| t.blank? } # These initialize one-time and accumulate values as parsing advances - terms= config.first_element # Accumulated SQL WHERE terms + terms= String::Builder.new(config.first_element) # Accumulated SQL WHERE terms values= [] of String # Their corresponding values (replacements for "?"s) count= tokens.size # Total number of tokens we have for parsing i= 0 # Current position in tokens array @@ -91,7 +91,7 @@ module TextToSqlSearch i+= 1 next when config.passthru_closing - terms+= token + terms<< token i+= 1 next when config.and_word