LP#1635737 White-space only cleanup
authorDan Wells <dbw2@calvin.edu>
Fri, 21 Jul 2017 17:56:18 +0000 (13:56 -0400)
committerDan Wells <dbw2@calvin.edu>
Fri, 21 Jul 2017 17:56:18 +0000 (13:56 -0400)
interval_to_seconds() has mixture of tabs and space AND a mixture of
4 and 8-space indents.  Clean it up to prepare for changes.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
src/perl/lib/OpenSRF/Utils.pm

index bb6858a..f840967 100644 (file)
@@ -249,27 +249,27 @@ for years (this is 365 * 1d)
 
 =cut
 sub interval_to_seconds {
-       my $self = shift;
-        my $interval = shift || $self;
-
-       $interval =~ s/(\d{2}):(\d{2}):(\d{2})/ $1 h $2 min $3 s /go;
-
-        $interval =~ s/and/,/g;
-        $interval =~ s/,/ /g;
-
-        my $amount = 0;
-        while ($interval =~ /\s*([\+-]?)\s*(\d+)\s*(\w+)\s*/g) {
-               my ($sign, $count, $type) = ($1, $2, $3);
-               $count = "$sign$count" if ($sign);
-                $amount += $count if ($type =~ /^s/);
-                $amount += 60 * $count if ($type =~ /^m(?!o)/oi);
-                $amount += 60 * 60 * $count if ($type =~ /^h/);
-                $amount += 60 * 60 * 24 * $count if ($type =~ /^d/oi);
-                $amount += 60 * 60 * 24 * 7 * $count if ($type =~ /^w/oi);
-                $amount += ((60 * 60 * 24 * 365)/12) * $count if ($type =~ /^mo/io);
-                $amount += 60 * 60 * 24 * 365 * $count if ($type =~ /^y/oi);
-        }
-        return $amount;
+    my $self = shift;
+    my $interval = shift || $self;
+
+    $interval =~ s/(\d{2}):(\d{2}):(\d{2})/ $1 h $2 min $3 s /go;
+
+    $interval =~ s/and/,/g;
+    $interval =~ s/,/ /g;
+
+    my $amount = 0;
+    while ($interval =~ /\s*([\+-]?)\s*(\d+)\s*(\w+)\s*/g) {
+        my ($sign, $count, $type) = ($1, $2, $3);
+        $count = "$sign$count" if ($sign);
+        $amount += $count if ($type =~ /^s/);
+        $amount += 60 * $count if ($type =~ /^m(?!o)/oi);
+        $amount += 60 * 60 * $count if ($type =~ /^h/);
+        $amount += 60 * 60 * 24 * $count if ($type =~ /^d/oi);
+        $amount += 60 * 60 * 24 * 7 * $count if ($type =~ /^w/oi);
+        $amount += ((60 * 60 * 24 * 365)/12) * $count if ($type =~ /^mo/io);
+        $amount += 60 * 60 * 24 * 365 * $count if ($type =~ /^y/oi);
+    }
+    return $amount;
 }
 
 sub seconds_to_interval {