]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: minor cleanups
authorEric Wong <e@80x24.org>
Sun, 6 Apr 2014 06:59:43 +0000 (06:59 +0000)
committerEric Wong <e@80x24.org>
Sun, 6 Apr 2014 06:59:43 +0000 (06:59 +0000)
Avoid adding extraneous whitespace in HTML content, as it
increases bandwidth usage of network, disk and memory.

lib/PublicInbox/View.pm

index 4ac28346c81ef52c8971f0f263466a9d56918f46..18ba36a85ba68e9e5fc061ce5a7f4c0be678facd 100644 (file)
@@ -8,13 +8,13 @@ use CGI qw/escapeHTML/;
 use Encode qw/decode encode/;
 use Encode::MIME::Header;
 
-# only one public function:
+# public functions:
 sub as_html {
        my ($class, $mime, $full_pfx) = @_;
 
        headers_to_html_header($mime) .
                multipart_text_as_html($mime, $full_pfx) .
-               "</pre>\n";
+               '</pre>';
 }
 
 sub as_feed_entry {
@@ -150,10 +150,8 @@ sub headers_to_html_header {
        }
        $rv .= "\n";
 
-       return ("<html><head><title>".
-               join(' - ', @title) .
-               '</title></head><body><pre style="white-space:pre-wrap">' .
-               $rv);
+       ("<html><head><title>".  join(' - ', @title) .
+        '</title></head><body><pre style="white-space:pre-wrap">' .  $rv);
 }
 
 1;