common: silence warning in showlink about unused href
[sheet.git] / common.inc.plp
index a1eb3e5e2a54ce24a0f7c9b110a6cdb5d5751b02..898e8bbcd5dd24774d6a32f166f14dae0def9fee 100644 (file)
@@ -233,10 +233,9 @@ BEGIN {
 
 sub showlink {
        my ($title, $href, $selected) = @_;
-       return sprintf(
-               !$href ? '%s' :
-               $selected ? '<strong>%s</strong>' : '<a href="%2$s">%s</a>',
-               EscapeHTML($title), EscapeHTML($href)
-       );
+       EscapeHTML($title);
+       return $title if not $href;
+       return "<strong>$title</strong>" if $selected;
+       return sprintf '<a href="%s">%s</a>', EscapeHTML($href), $title;
 }