Make history deletion more efficient
This commit is contained in:
parent
b9aed893ef
commit
e92ad4303b
@ -76,11 +76,8 @@ public class HistoryDatabaseHandler extends SQLiteOpenHelper {
|
||||
* All CRUD(Create, Read, Update, Delete) Operations
|
||||
*/
|
||||
|
||||
public synchronized void delete(String url) {
|
||||
String n = getHistoryItem(url);
|
||||
if (n != null) {
|
||||
deleteHistoryItem(n);
|
||||
}
|
||||
public synchronized void deleteHistoryItem(String url) {
|
||||
mDatabase.delete(TABLE_HISTORY, KEY_URL + " = ?", new String[] { url });
|
||||
}
|
||||
|
||||
public synchronized void visitHistoryItem(String url, String title) {
|
||||
@ -193,11 +190,6 @@ public class HistoryDatabaseHandler extends SQLiteOpenHelper {
|
||||
return n;
|
||||
}
|
||||
|
||||
// Deleting single item
|
||||
public synchronized void deleteHistoryItem(String id) {
|
||||
mDatabase.delete(TABLE_HISTORY, KEY_ID + " = ?", new String[] { String.valueOf(id) });
|
||||
}
|
||||
|
||||
// Getting items Count
|
||||
public int getHistoryItemsCount() {
|
||||
String countQuery = "SELECT * FROM " + TABLE_HISTORY;
|
||||
|
Loading…
x
Reference in New Issue
Block a user