From 2d44771eb7e09e99a6b1fb27bf2ce3010c9c1ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Trob=C3=A4ck?= Date: Mon, 7 Nov 2016 12:53:08 +0100 Subject: [PATCH] Code cleanup --- buildIndex.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/buildIndex.js b/buildIndex.js index 41e63454..178c3ced 100644 --- a/buildIndex.js +++ b/buildIndex.js @@ -11,11 +11,9 @@ const readFile = (dir, file) => { filename: file }; - if (country.Government['Country name'] && country.Government['Country name']['conventional short form']) { - currentCountry.country = country.Government['Country name']['conventional short form'].text; - } else { - currentCountry.country = ''; - } + currentCountry.country = (country.Government['Country name'] && + country.Government['Country name']['conventional short form']) ? + country.Government['Country name']['conventional short form'].text : ''; countryIndex.push(currentCountry); };