mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 794631 - Don't add useless WHERE clauses to empty filter queries. r=lucasr
This commit is contained in:
parent
26ad5de498
commit
af3a59eda5
@ -24,6 +24,7 @@ import android.graphics.BitmapFactory;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.net.Uri;
|
||||
import android.provider.Browser;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@ -138,6 +139,7 @@ public class LocalBrowserDB implements BrowserDB.BrowserDBIface {
|
||||
|
||||
// The combined history/bookmarks selection queries for sites with a url or title containing
|
||||
// the constraint string(s), treating space-separated words as separate constraints
|
||||
if (!TextUtils.isEmpty(constraint)) {
|
||||
String[] constraintWords = constraint.toString().split(" ");
|
||||
for (int i = 0; i < constraintWords.length; i++) {
|
||||
selection = DBUtils.concatenateWhere(selection, "(" + Combined.URL + " LIKE ? OR " +
|
||||
@ -146,6 +148,7 @@ public class LocalBrowserDB implements BrowserDB.BrowserDBIface {
|
||||
selectionArgs = DBUtils.appendSelectionArgs(selectionArgs,
|
||||
new String[] { constraintWord, constraintWord });
|
||||
}
|
||||
}
|
||||
|
||||
if (urlFilter != null) {
|
||||
selection = DBUtils.concatenateWhere(selection, "(" + Combined.URL + " NOT LIKE ?)");
|
||||
|
Loading…
Reference in New Issue
Block a user