diff --git a/content/editor.js b/content/editor.js
index 0210f125..3b70272d 100644
--- a/content/editor.js
+++ b/content/editor.js
@@ -931,7 +931,7 @@ liberator.Editor = function () //{{{
let list =
{
- liberator.template.map2(abbrev, function (lhs, rhs)
+ liberator.template.map(abbrev, function (lhs, rhs)
liberator.template.map(rhs, function (abbr)
searchFilter.indexOf(abbr[0]) < 0 ? undefined :
diff --git a/content/events.js b/content/events.js
index e3bf5499..8d996d64 100644
--- a/content/events.js
+++ b/content/events.js
@@ -233,7 +233,7 @@ liberator.AutoCommands = function () //{{{
| ----- Auto Commands ----- |
{
- liberator.template.map2(cmds, function (event, items)
+ liberator.template.map(cmds, function (event, items)
| {event} |
diff --git a/content/options.js b/content/options.js
index a9edfc40..fe9aceb0 100644
--- a/content/options.js
+++ b/content/options.js
@@ -284,7 +284,7 @@ liberator.Options = function () //{{{
var str =
{
- liberator.template.map2(liberator.globalVariables, function (i, value) {
+ liberator.template.map(liberator.globalVariables, function (i, value) {
let prefix = typeof value == "number" ? "#" :
typeof value == "function" ? "*" :
" ";
diff --git a/content/template.js b/content/template.js
index b7ebda84..b47b6c62 100644
--- a/content/template.js
+++ b/content/template.js
@@ -5,7 +5,12 @@ liberator.template = {
map: function (iter, fn, sep)
{
- if (iter.length) /* Kludge? */
+ if (fn.length > 1)
+ {
+ iter = Iterator(iter);
+ fn = function (x) fn.apply(null, x);
+ }
+ else if (iter.length) /* Kludge? */
iter = liberator.util.arrayIter(iter);
let ret = <>>;
let n = 0;
@@ -20,11 +25,6 @@ liberator.template = {
}
return ret;
},
- map2: function (iter, fn, sep)
- {
- // Could cause performance problems.
- return this.map(Iterator(iter), function (x) fn.apply(null, x), sep);
- },
maybeXML: function (xml)
{
@@ -143,7 +143,7 @@ liberator.template = {
| jump | title | URI |
{
- this.map2(elems, function (idx, val)
+ this.map(elems, function (idx, val)
| {idx == index ? ">" : ""} |
{Math.abs(idx - index)} |
@@ -207,7 +207,7 @@ liberator.template = {
this.map(iter, function (row)
{
- liberator.template.map2(row, function (i, d)
+ liberator.template.map(row, function (i, d)
| {d} | )
}
)