mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 868952 - Fix the getAll(...) function in AlarmDB to be more efficient. r=clian
This commit is contained in:
parent
414da4c45b
commit
cd7c034c2d
@ -139,15 +139,13 @@ AlarmDB.prototype = {
|
||||
"readonly",
|
||||
ALARMSTORE_NAME,
|
||||
function txnCb(aTxn, aStore) {
|
||||
if (!aTxn.result)
|
||||
if (!aTxn.result) {
|
||||
aTxn.result = [];
|
||||
}
|
||||
|
||||
aStore.mozGetAll().onsuccess = function setTxnResult(aEvent) {
|
||||
aEvent.target.result.forEach(function addAlarm(aAlarm) {
|
||||
if (!aManifestURL || aManifestURL == aAlarm.manifestURL)
|
||||
aTxn.result.push(aAlarm);
|
||||
});
|
||||
|
||||
let index = aStore.index("manifestURL");
|
||||
index.mozGetAll(aManifestURL).onsuccess = function setTxnResult(aEvent) {
|
||||
aTxn.result = aEvent.target.result;
|
||||
debug("Request successful. Record count: " + aTxn.result.length);
|
||||
};
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user