From 1bc52f49134ffffadde61264a6f2d3cbb001af37 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 30 Jan 2021 20:29:49 -0500 Subject: [PATCH] hooks: Remove unnecessary `callAllStr()` function --- src/static/js/linestylefilter.js | 7 ++----- src/static/js/pluginfw/hooks.js | 12 ------------ 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/static/js/linestylefilter.js b/src/static/js/linestylefilter.js index f70eefc23..254168990 100644 --- a/src/static/js/linestylefilter.js +++ b/src/static/js/linestylefilter.js @@ -93,11 +93,8 @@ linestylefilter.getLineStyleFilter = (lineLength, aline, textAndClassFunc, apool } else if (linestylefilter.ATTRIB_CLASSES[key]) { classes += ` ${linestylefilter.ATTRIB_CLASSES[key]}`; } else { - classes += hooks.callAllStr('aceAttribsToClasses', { - linestylefilter, - key, - value, - }, ' ', ' ', ''); + const results = hooks.callAll('aceAttribsToClasses', {linestylefilter, key, value}); + classes += ` ${results.join(' ')}`; } } } diff --git a/src/static/js/pluginfw/hooks.js b/src/static/js/pluginfw/hooks.js index e61079eb6..e0b733e5d 100644 --- a/src/static/js/pluginfw/hooks.js +++ b/src/static/js/pluginfw/hooks.js @@ -386,18 +386,6 @@ exports.aCallFirst = (hook_name, args, cb, predicate) => { } }; -exports.callAllStr = (hook_name, args, sep, pre, post) => { - if (sep === undefined) sep = ''; - if (pre === undefined) pre = ''; - if (post === undefined) post = ''; - const newCallhooks = []; - const callhooks = exports.callAll(hook_name, args); - for (let i = 0, ii = callhooks.length; i < ii; i++) { - newCallhooks[i] = pre + callhooks[i] + post; - } - return newCallhooks.join(sep || ''); -}; - exports.exportedForTestingOnly = { callHookFnAsync, callHookFnSync,