mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Use more for...of
loops in the code-base
Note that these cases, which are all in older code, were found using the [`unicorn/no-for-loop`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md) ESLint plugin rule. However, note that I've opted not to enable this rule by default since there's still *some* cases where I do think that it makes sense to allow "regular" for-loops.
This commit is contained in:
parent
5bfba89b0a
commit
37ebc28756
14 changed files with 35 additions and 50 deletions
|
@ -2211,8 +2211,7 @@ class CanvasGraphics {
|
|||
|
||||
ctx.save();
|
||||
ctx.beginPath();
|
||||
for (let i = 0; i < paths.length; i++) {
|
||||
const path = paths[i];
|
||||
for (const path of paths) {
|
||||
ctx.setTransform.apply(ctx, path.transform);
|
||||
ctx.translate(path.x, path.y);
|
||||
path.addToPath(ctx, path.fontSize);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue