mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
Merge pull request #19703 from Snuffleupagus/bidi-rm-setValues
Replace the `setValues` function with `Array.prototype.fill()` in the `src/core/bidi.js` file
This commit is contained in:
commit
7f70835830
1 changed files with 1 additions and 7 deletions
|
@ -91,12 +91,6 @@ function findUnequal(arr, start, value) {
|
|||
return j;
|
||||
}
|
||||
|
||||
function setValues(arr, start, end, value) {
|
||||
for (let j = start; j < end; ++j) {
|
||||
arr[j] = value;
|
||||
}
|
||||
}
|
||||
|
||||
function reverseValues(arr, start, end) {
|
||||
for (let i = start, j = end - 1; i < j; ++i, --j) {
|
||||
const temp = arr[i];
|
||||
|
@ -323,7 +317,7 @@ function bidi(str, startLevel = -1, vertical = false) {
|
|||
after = "R";
|
||||
}
|
||||
if (before === after) {
|
||||
setValues(types, i, end, before);
|
||||
types.fill(before, i, end);
|
||||
}
|
||||
i = end - 1; // reset to end (-1 so next iteration is ok)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue