mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-02 06:20:14 +01:00
build query a bit more effeciently
This commit is contained in:
parent
38fe8ec3fd
commit
c7818bd364
1 changed files with 2 additions and 7 deletions
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue