Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Sep 4, 2023
1 parent 6aa78fc commit 4e65633
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,9 @@ function browse(options, callback) {
this.getMissedNames = function (devices, callback) {
let cnt = 0;
(function doIt() {
if (cnt >= devices.length) return callback();
if (cnt >= devices.length) {
return callback();
}
const dev = devices[cnt++];

if (dev._name) {
Expand Down Expand Up @@ -742,11 +744,11 @@ function browse(options, callback) {
} else {
let uneq = true;
const namex = `${name}x`;
if (specialEntryNames.indexOf(name) >= 0 && dest[name] && from[name] !== undefined && (uneq = (dest[name] !== from[name]))) {
if (specialEntryNames.includes(name) && dest[name] && from[name] !== undefined && (uneq = (dest[name] !== from[name]))) {
if (dest[namex] === undefined) {
dest[namex] = [dest[name]];
}
if (from[name] && dest[namex].indexOf(from[name]) < 0) {
if (from[name] && !dest[namex].includes(from[name])) {
dest[namex].push(from[name]);
}
}
Expand Down

0 comments on commit 4e65633

Please sign in to comment.