From f2d257510e08803cf9a47c3eb73dcfde9aa30105 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Mon, 23 Jul 2018 19:25:47 +1000 Subject: [PATCH] * Subtitle::Utils : minor optimizations --- lib/Subtitle/Utils.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Subtitle/Utils.pm b/lib/Subtitle/Utils.pm index 7ccde74..991bc64 100644 --- a/lib/Subtitle/Utils.pm +++ b/lib/Subtitle/Utils.pm @@ -16,11 +16,11 @@ our %EXPORT_TAGS = ( timing => [qw(make_timing parse_timing)], ); -## string sunctions +## string functions sub chomp_all { - return unless @_; - return $_ =~ s/[\r\n]+$//o for @_; + return unless $_[0]; + $_[0] =~ s/[\r\n]+$//o; } sub strip_bom { @@ -29,8 +29,8 @@ sub strip_bom { } sub trim { - return unless @_; - $_ =~ s/(^\s+|\s+$)//go for @_; + return unless $_[0]; + $_[0] =~ s/(^\s+|\s+$)//go; } ## timing functions @@ -101,9 +101,9 @@ Subtitle::Utils -- usefull generic routines =head2 C chomp($line); - chomp($line1, $line2); In-place strips newlines (CR/LF) from line. +Differs from standart chomp() than strips '\r', '\n' and it's combinaion, disregarding $/ =head2 C