Small refactoring
authorVincent Tondellier <tonton+hg@team1664.org>
Mon, 28 Dec 2015 23:07:16 +0100
changeset 87 03caeafba2ff
parent 86 96818eff346b
child 88 c82f5589db11
Small refactoring
lib/CrashTest/Plugin/StackFilter/HideArgs.pm
--- a/lib/CrashTest/Plugin/StackFilter/HideArgs.pm	Mon Dec 28 23:00:47 2015 +0100
+++ b/lib/CrashTest/Plugin/StackFilter/HideArgs.pm	Mon Dec 28 23:07:16 2015 +0100
@@ -25,7 +25,11 @@
     $thread->each_frame(sub {
             my $frame = shift;
 
-            $frame->function_name($self->shorten_signature($frame->function_name));
+            $frame->function_name(
+                $self->app->t(code => (title => $frame->function_name, class => "shortened-signature prettyprint lang-cpp") =>
+                    shorten_signature($frame->function_name)
+                )
+            );
         }
     );
 
@@ -33,7 +37,7 @@
 }
 
 sub shorten_signature {
-    my ($self, $signature) = @_;
+    my $signature = shift;
 
     return "" if(!defined($signature) || $signature eq "");
 
@@ -50,7 +54,7 @@
         }
     } while($text);
 
-    return $self->app->t(code => (title => $signature, class => "shortened-signature prettyprint lang-cpp") => $short_signature);
+    return $short_signature;
 }
 
 1;