Skip to content

Commit fe19d96

Browse files
committed
Replace the setValues function with Array.prototype.fill() in the src/core/bidi.js file
This code is originally from 2012, see PR 1218, and the Array-method wasn't available until Firefox 31 (released on 2014-07-22).
1 parent 8f4c016 commit fe19d96

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)