mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +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 );
|
String selection = String.format( "%s = %d", DBHelper.LANGUAGE, lang );
|
||||||
if ( null != words ) {
|
if ( null != words ) {
|
||||||
String[] inQuotes = new String[words.length];
|
selection += String.format( " AND %s in ('%s')", DBHelper.WORD,
|
||||||
for ( int ii = 0; ii < inQuotes.length; ++ii ) {
|
TextUtils.join("','", words) );
|
||||||
inQuotes[ii] = String.format( "'%s'", words[ii] );
|
|
||||||
}
|
|
||||||
String wordsTest = String.format( " AND %s in (%s)", DBHelper.WORD,
|
|
||||||
TextUtils.join(",", inQuotes) );
|
|
||||||
selection += wordsTest;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initDB( context );
|
initDB( context );
|
||||||
|
|
Loading…
Reference in a new issue