Don't duplicate sql string code as suggested by pserwylo

This commit is contained in:
Daniel Martí 2015-04-01 00:28:09 +02:00
parent 3db3a516eb
commit 11205dcf72

View File

@ -522,19 +522,19 @@ public class AppProvider extends FDroidProvider {
boolean firstColumn = true;
for (final String column : columns) {
if (firstColumn) {
selection.append("(");
firstColumn = false;
} else {
selection.append("OR (");
selection.append("OR ");
}
selection.append("(");
boolean firstKeyword = true;
for (final String keyword : keywords) {
if (firstKeyword) {
selection.append(column + " like ?");
firstKeyword = false;
} else {
selection.append(" OR " + column + " like ?");
selection.append(" OR ");
}
selection.append(column + " like ?");
selectionKeywords[iKeyword] = keyword;
iKeyword++;
}