]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
[misc] Remove unnecessary ternary spotted by Coverity (#4663)
authorAsh <ash@hexmen.com>
Wed, 31 Oct 2018 03:18:54 +0000 (03:18 +0000)
committerKunal Marwaha <marwahaha@berkeley.edu>
Wed, 31 Oct 2018 03:18:54 +0000 (23:18 -0400)
src/lib/duration/create.js
src/locale/sl.js

index 346814816f10609fce90c8e10aae1d410ee5b96d..7d1d052129ff3499a0956218b21c6b767047d869 100644 (file)
@@ -48,7 +48,7 @@ export function createDuration (input, key) {
             ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
         };
     } else if (!!(match = isoRegex.exec(input))) {
-        sign = (match[1] === '-') ? -1 : (match[1] === '+') ? 1 : 1;
+        sign = (match[1] === '-') ? -1 : 1;
         duration = {
             y : parseIso(match[2], sign),
             M : parseIso(match[3], sign),
index b37b7ed2c6094c9491b8b7391cc613ea2b0c59ac..8ece81bfa4dbd183eeb81d521e758a5f436e2cb9 100644 (file)
@@ -17,7 +17,7 @@ function processRelativeTime(number, withoutSuffix, key, isFuture) {
             } else if (number < 5) {
                 result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';
             } else {
-                result += withoutSuffix || isFuture ? 'sekund' : 'sekund';
+                result += 'sekund';
             }
             return result;
         case 'm':