mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-25 18:06:15 -04:00
Replace separate attrib key, value calls with single pair call
This commit is contained in:
parent
6cf2055199
commit
1f227200da
3 changed files with 13 additions and 36 deletions
|
@ -166,9 +166,7 @@ AttributeManager.prototype = _(AttributeManager.prototype).extend({
|
|||
const op = opIter.next();
|
||||
if (!op.attribs) return [];
|
||||
const attributes = [];
|
||||
Changeset.eachAttribNumber(op.attribs, (n) => {
|
||||
attributes.push([this.rep.apool.getAttribKey(n), this.rep.apool.getAttribValue(n)]);
|
||||
});
|
||||
Changeset.eachAttribNumber(op.attribs, (n) => attributes.push(this.rep.apool.getAttrib(n)));
|
||||
return attributes;
|
||||
},
|
||||
|
||||
|
@ -277,12 +275,8 @@ AttributeManager.prototype = _(AttributeManager.prototype).extend({
|
|||
currentPointer += currentOperation.chars;
|
||||
if (currentPointer <= column) continue;
|
||||
const attributes = [];
|
||||
Changeset.eachAttribNumber(currentOperation.attribs, (n) => {
|
||||
attributes.push([
|
||||
this.rep.apool.getAttribKey(n),
|
||||
this.rep.apool.getAttribValue(n),
|
||||
]);
|
||||
});
|
||||
Changeset.eachAttribNumber(
|
||||
currentOperation.attribs, (n) => attributes.push(this.rep.apool.getAttrib(n)));
|
||||
return attributes;
|
||||
}
|
||||
return [];
|
||||
|
|
|
@ -75,11 +75,8 @@ linestylefilter.getLineStyleFilter = (lineLength, aline, textAndClassFunc, apool
|
|||
|
||||
// For each attribute number
|
||||
Changeset.eachAttribNumber(attribs, (n) => {
|
||||
// Give us this attributes key
|
||||
const key = apool.getAttribKey(n);
|
||||
if (!key) return;
|
||||
const value = apool.getAttribValue(n);
|
||||
if (!value) return;
|
||||
const [key, value] = apool.getAttrib(n);
|
||||
if (!key || !value) return;
|
||||
if (!isLineAttribMarker && AttributeManager.lineAttributes.indexOf(key) >= 0) {
|
||||
isLineAttribMarker = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue