1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-04-29 06:34:06 +02:00

Use builtin String.startsWith, String.endsWith, and String.contains methods where appropriate.

This commit is contained in:
Kris Maglione
2014-02-22 15:17:08 -08:00
parent 6790c62c41
commit 51eb03c376
19 changed files with 40 additions and 39 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ var MAX_LOAD_TIME = 10 * 1000;
let prefix = "DOWNLOAD_";
var states = iter([v, k.slice(prefix.length).toLowerCase()]
for ([k, v] in Iterator(Ci.nsIDownloadManager))
if (k.indexOf(prefix) == 0))
if (k.startsWith(prefix)))
.toObject();
var Download = Class("Download", {
@@ -288,7 +288,7 @@ var DownloadList = Class("DownloadList",
addDownload: function addDownload(download) {
if (!this.downloads.has(download)) {
download = Download(download, this);
if (this.filter && download.displayName.indexOf(this.filter) === -1)
if (this.filter && !download.displayName.contains(this.filter))
return;
this.downloads.set(download.download, download);