]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
[misc] Remove unused variable defaults (#4959)
authorRonny Roeller <ronnyroeller@users.noreply.github.com>
Mon, 21 Jan 2019 20:35:24 +0000 (21:35 +0100)
committerKunal Marwaha <marwahaha@berkeley.edu>
Mon, 21 Jan 2019 20:35:24 +0000 (12:35 -0800)
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.

src/lib/duration/create.js

index 7d1d052129ff3499a0956218b21c6b767047d869..3f00f3aad4c350e979304d8c14ebd07ef6ce9904 100644 (file)
@@ -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;