From c7818bd364183e255028f0ff832d167b15ea75b8 Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 19 Mar 2014 22:52:33 -0700 Subject: [PATCH] build query a bit more effeciently --- .../XWords4/src/org/eehouse/android/xw4/DBUtils.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java index 2ef1724f5..6635c26ca 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java @@ -1669,13 +1669,8 @@ public class DBUtils { { String selection = String.format( "%s = %d", DBHelper.LANGUAGE, lang ); if ( null != words ) { - String[] inQuotes = new String[words.length]; - for ( int ii = 0; ii < inQuotes.length; ++ii ) { - inQuotes[ii] = String.format( "'%s'", words[ii] ); - } - String wordsTest = String.format( " AND %s in (%s)", DBHelper.WORD, - TextUtils.join(",", inQuotes) ); - selection += wordsTest; + selection += String.format( " AND %s in ('%s')", DBHelper.WORD, + TextUtils.join("','", words) ); } initDB( context );