Skip to content
This repository was archived by the owner on Mar 29, 2021. It is now read-only.

Commit 4dc3044

Browse files
committed
removing unecessary condition
1 parent 0ec836a commit 4dc3044

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

src/mods/tier.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ idrinth.tier = {
185185
*/
186186
var makeField = function ( listKey, difficulty, ic ) {
187187
var ln = {
188-
type: 'td'
188+
type: 'td',
189+
attributes: []
189190
};
190191
/**
191192
*
@@ -196,19 +197,14 @@ idrinth.tier = {
196197
* @returns {object} for the buildElement wrapper
197198
*/
198199
var addTitle = function ( ln, listKey, difficulty, ic ) {
199-
if ( !idrinth.tier.list[listKey].hasOwnProperty ( 'loot' ) ) {
200-
return ln;
201-
}
202-
if ( !idrinth.tier.list[listKey].loot.hasOwnProperty ( difficulty ) ) {
203-
return ln;
204-
}
205-
if ( !idrinth.tier.list[listKey].loot[difficulty].hasOwnProperty ( ic ) ) {
206-
return ln;
207-
}
208-
if ( !idrinth.tier.list[listKey].loot[difficulty][ic] ) {
200+
if (
201+
!idrinth.tier.list[listKey].hasOwnProperty ( 'loot' ) ||
202+
!idrinth.tier.list[listKey].loot.hasOwnProperty ( difficulty ) ||
203+
!idrinth.tier.list[listKey].loot[difficulty].hasOwnProperty ( ic ) ||
204+
!idrinth.tier.list[listKey].loot[difficulty][ic]
205+
) {
209206
return ln;
210207
}
211-
ln.attributes = ln.attributes ? ln.attributes : [ ];
212208
var title = "";
213209
for (var key in idrinth.tier.list[listKey].loot[difficulty][ic]) {
214210
if ( idrinth.tier.list[listKey].loot[difficulty][ic].hasOwnProperty ( key ) ) {

0 commit comments

Comments
 (0)