Index: lib/filterStorage.js |
=================================================================== |
--- a/lib/filterStorage.js |
+++ b/lib/filterStorage.js |
@@ -481,46 +481,37 @@ |
subscriptions.push(subscription); |
} |
} |
yield "# Adblock Plus preferences"; |
yield "version=" + this.formatVersion; |
let saved = new Set(); |
- let buf = []; |
// Save subscriptions |
for (let subscription of subscriptions) |
{ |
- yield ""; |
+ yield* subscription.serialize(); |
- subscription.serialize(buf); |
if (subscription.filters.length) |
Manish Jethani
2018/10/22 20:18:01
We don't really need this check, as I said in my p
Jon Sonesen
2018/10/22 22:59:36
My bad, I'll fix it
|
{ |
- buf.push("", "[Subscription filters]"); |
- subscription.serializeFilters(buf); |
+ yield* subscription.serializeFilters(); |
} |
- for (let line of buf) |
- yield line; |
- buf.splice(0); |
} |
// Save filter data |
for (let subscription of subscriptions) |
{ |
for (let filter of subscription.filters) |
{ |
if (!saved.has(filter.text)) |
{ |
- filter.serialize(buf); |
+ yield* filter.serialize(); |
saved.add(filter.text); |
- for (let line of buf) |
- yield line; |
- buf.splice(0); |
} |
} |
} |
} |
/** |
* Saves all subscriptions back to disk. |
* @returns {Promise} A promise resolved or rejected when saving is complete. |