From d277dd5c1cfe9ef2265fdd02af4341879268efb2 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 19 Dec 2008 23:24:31 +1100 Subject: [PATCH] minor refactoring of :dialog action --- common/content/liberator.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/common/content/liberator.js b/common/content/liberator.js index 30283ee6..2edaa653 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -232,12 +232,16 @@ const liberator = (function () //{{{ try { + // TODO: why are these sorts of properties arrays? --djk let dialogs = config.dialogs; - for (let i = 0; i < dialogs.length; i++) + for (let [,dialog] in Iterator(dialogs)) { - if (dialogs[i][0] == arg) - return dialogs[i][2](); + if (arg == dialog[0]) + { + dialog[2](); + return; + } } liberator.echoerr("E475: Invalid argument: " + arg);