Browse Source

P4TB-391: Follow-up to commit 56d9aee0 and commit 4c369760: Simplify code (replace loop with .includes()).

master
Jörg Knobloch 1 year ago
parent
commit
eb01d503f7
2 changed files with 2 additions and 18 deletions
  1. +1
    -9
      addon/content/pepmessengercompose.js
  2. +1
    -9
      addon/content/pepmsghdrview.js

+ 1
- 9
addon/content/pepmessengercompose.js View File

@ -372,7 +372,6 @@ var pEpComposer = {
let dotPos = name.lastIndexOf(".");
let tryAppend = 1;
let newName;
let found;
do {
tryAppend++;
if (dotPos < 0) {
@ -380,14 +379,7 @@ var pEpComposer = {
} else {
newName = `${name.substring(0, dotPos)}(${tryAppend})${name.substring(dotPos)}`;
}
found = false;
for (let k = 0; k < rowCount; k++) {
if (newName == attachmentNames[k]) {
found = true;
break;
}
}
} while (found);
} while (attachmentNames.includes(newName));
attachmentNames[j] = newName;
let item = bucket.getItemAtIndex(j);


+ 1
- 9
addon/content/pepmsghdrview.js View File

@ -353,7 +353,6 @@ var pEpHdrView = {
let dotPos = name.lastIndexOf(".");
let tryAppend = 1;
let newName;
let found;
do {
tryAppend++;
if (dotPos < 0) {
@ -361,14 +360,7 @@ var pEpHdrView = {
} else {
newName = `${name.substring(0, dotPos)}(${tryAppend})${name.substring(dotPos)}`;
}
found = false;
for (let k = 0; k < attLength; k++) {
if (newName == attachmentNames[k]) {
found = true;
break;
}
}
} while (found);
} while (attachmentNames.includes(newName));
attachmentNames[j] = newName;
this.win.currentAttachments[j].name = newName;


Loading…
Cancel
Save