From: Ronny Roeller Date: Mon, 21 Jan 2019 20:35:24 +0000 (+0100) Subject: [misc] Remove unused variable defaults (#4959) X-Git-Tag: 2.24.0~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01ae8ca220d1ff84d3d26491eadea1afc5780d2b;p=thirdparty%2Fmoment.git [misc] Remove unused variable defaults (#4959) The default values of the initialized fields are overwritten in the following lines. This means that the code never relies on the variable defaults. Removing the unused defaults makes the code easier to read. --- diff --git a/src/lib/duration/create.js b/src/lib/duration/create.js index 7d1d05212..3f00f3aad 100644 --- a/src/lib/duration/create.js +++ b/src/lib/duration/create.js @@ -90,7 +90,7 @@ function parseIso (inp, sign) { } function positiveMomentsDifference(base, other) { - var res = {milliseconds: 0, months: 0}; + var res = {}; res.months = other.month() - base.month() + (other.year() - base.year()) * 12;