Use for...of for performance optimizations (#1509)

* Use for...of for performance optimizations

* Fix ignores

* Remove console times
This commit is contained in:
Dominic Gannaway
2022-03-23 03:17:48 +00:00
committed by acywatson
parent 7dbba00306
commit db26e25d7a
18 changed files with 29 additions and 79 deletions

View File

@ -100,7 +100,6 @@ function findOffset(
if (typeof Segmenter === 'function') {
const segmenter = new Segmenter();
const graphemes = segmenter.segment(text);
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
for (const {segment: grapheme} of graphemes) {
const nextOffset = offset + strlen(grapheme);
if (nextOffset > maxCharacters) {