[vlc-commits] macosx: Remove unnecessary variable and llabs call

Marvin Scholz git at videolan.org
Tue Oct 9 14:19:19 CEST 2018


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Tue Oct  9 14:18:55 2018 +0200| [07ff5ec31dfb670ead833d572139340e6d2b3251] | committer: Marvin Scholz

macosx: Remove unnecessary variable and llabs call

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=07ff5ec31dfb670ead833d572139340e6d2b3251
---

 modules/gui/macosx/NSString+Helpers.m | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/modules/gui/macosx/NSString+Helpers.m b/modules/gui/macosx/NSString+Helpers.m
index 9623afd7ad..cd77d83472 100644
--- a/modules/gui/macosx/NSString+Helpers.m
+++ b/modules/gui/macosx/NSString+Helpers.m
@@ -56,18 +56,17 @@
 + (instancetype)stringWithTime:(long long int)time
 {
     if (time > 0) {
-        long long positiveDuration = llabs(time);
-        if (positiveDuration > 3600)
+        if (time > 3600)
             return [NSString stringWithFormat:@"%s%01ld:%02ld:%02ld",
                     time < 0 ? "-" : "",
-                    (long) (positiveDuration / 3600),
-                    (long)((positiveDuration / 60) % 60),
-                    (long) (positiveDuration % 60)];
+                    (long) (time / 3600),
+                    (long)((time / 60) % 60),
+                    (long) (time % 60)];
         else
             return [NSString stringWithFormat:@"%s%02ld:%02ld",
                     time < 0 ? "-" : "",
-                    (long)((positiveDuration / 60) % 60),
-                    (long) (positiveDuration % 60)];
+                    (long)((time / 60) % 60),
+                    (long) (time % 60)];
     } else {
         // Return a string that represents an undefined time.
         return @"--:--";



More information about the vlc-commits mailing list