Skip to content

Commit

Permalink
immedate return
Browse files Browse the repository at this point in the history
  • Loading branch information
noogen committed Feb 13, 2021
1 parent 3befa18 commit a02cfd1
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/primaryVendors.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,30 +58,24 @@ class Handlers {
}

static syndigoExtractAsset(components, attrId) {
let result = null

if (Array.isArray(components)) {
let i = 0;
for(i=0; i < components.length; i++) {
for (i=0; i < components.length; i++) {
let comp = components[i]
if (comp.Assets && comp.Assets['en-US']) {
let j = 0
for (j=0; j < comp.Assets['en-US'].length; j++) {
let asset = comp.Assets['en-US'][j]
if (asset.AttributeId === attrId) {
result = asset
break;
// immediately return if found
return asset
}
}
}

if (result) {
break
}
}
}

return result
return null
}

static syndigoExtractMainImage(components) {
Expand Down

0 comments on commit a02cfd1

Please sign in to comment.