From a7c78768a197022f4fd1aba13fd0aa0a2a4d83d2 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 30 Sep 2021 23:54:10 -0400 Subject: [PATCH] ExportHelper: Simplify `_analyzeLine()` a bit --- src/node/utils/ExportHelper.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/node/utils/ExportHelper.js b/src/node/utils/ExportHelper.js index 0c593eca1..ba71269d1 100644 --- a/src/node/utils/ExportHelper.js +++ b/src/node/utils/ExportHelper.js @@ -53,7 +53,8 @@ exports._analyzeLine = (text, aline, apool) => { if (aline) { const opIter = Changeset.opIterator(aline); if (opIter.hasNext()) { - let listType = Changeset.opAttributeValue(opIter.next(), 'list', apool); + const op = opIter.next(); + let listType = Changeset.opAttributeValue(op, 'list', apool); if (listType) { lineMarker = 1; listType = /([a-z]+)([0-9]+)/.exec(listType); @@ -62,10 +63,7 @@ exports._analyzeLine = (text, aline, apool) => { line.listLevel = Number(listType[2]); } } - } - const opIter2 = Changeset.opIterator(aline); - if (opIter2.hasNext()) { - const start = Changeset.opAttributeValue(opIter2.next(), 'start', apool); + const start = Changeset.opAttributeValue(op, 'start', apool); if (start) { line.start = start; }