mirror of
https://github.com/facebook/lexical.git
synced 2025-08-06 16:39:33 +08:00
Use for...of for performance optimizations (#1509)
* Use for...of for performance optimizations * Fix ignores * Remove console times
This commit is contained in:

committed by
acywatson

parent
7dbba00306
commit
db26e25d7a
@ -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) {
|
||||
|
Reference in New Issue
Block a user