Skip to content

Commit 7f70835

Browse files
Merge pull request #19703 from Snuffleupagus/bidi-rm-setValues
Replace the `setValues` function with `Array.prototype.fill()` in the `src/core/bidi.js` file
2 parents 8f4c016 + fe19d96 commit 7f70835

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

src/core/bidi.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,6 @@ function findUnequal(arr, start, value) {
9191
return j;
9292
}
9393

94-
function setValues(arr, start, end, value) {
95-
for (let j = start; j < end; ++j) {
96-
arr[j] = value;
97-
}
98-
}
99-
10094
function reverseValues(arr, start, end) {
10195
for (let i = start, j = end - 1; i < j; ++i, --j) {
10296
const temp = arr[i];
@@ -323,7 +317,7 @@ function bidi(str, startLevel = -1, vertical = false) {
323317
after = "R";
324318
}
325319
if (before === after) {
326-
setValues(types, i, end, before);
320+
types.fill(before, i, end);
327321
}
328322
i = end - 1; // reset to end (-1 so next iteration is ok)
329323
}

0 commit comments

Comments
 (0)