Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0793a5a6 authored by Daniel Jacob Chittoor's avatar Daniel Jacob Chittoor
Browse files

Rename inner loop variable to avoid shadowing

The nested loop in downloadAndUnzipFolder() reuses variable name 'i'
for both the outer folder iteration and inner zip entries iteration.
While JavaScript's block scoping with 'let' makes this technically
correct, it's confusing during debugging and prone to copy-paste errors.

Rename inner loop variable from 'i' to 'j' for clarity.
parent 65bcecd2
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -80,15 +80,15 @@ export class Downloader {
          if (file.unzip) {
            const zipReader = new ZipReader(new BlobReader(blob));
            const filesEntries = await zipReader.getEntries();
            for (let i = 0; i < filesEntries.length; i++) {
            for (let j = 0; j < filesEntries.length; j++) {
              const unzippedEntry = await this.getFileFromZip(
                filesEntries[i],
                filesEntries[j],
                (value, total) => {
                  onUnzipProgress(value, total, filesEntries[i].filename);
                  onUnzipProgress(value, total, filesEntries[j].filename);
                },
              );
              let filename = this.getMappedName(
                filesEntries[i].filename,
                filesEntries[j].filename,
                file.mapping,
              );
              if (filesRequired.includes(filename)) {