texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/Convert/Plaintext.pm: When outputtin


From: Gavin D. Smith
Subject: branch master updated: * tp/Texinfo/Convert/Plaintext.pm: When outputting a single newline, call _stream_output instead of _stream_output_encoded. This reduces calls to _stream_byte_count to encode the output and allows output to be encoded in fewer, bigger chunks.
Date: Mon, 22 Jan 2024 15:15:23 -0500

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 38c17a740b * tp/Texinfo/Convert/Plaintext.pm: When outputting a single 
newline, call _stream_output instead of _stream_output_encoded.  This reduces 
calls to _stream_byte_count to encode the output and allows output to be 
encoded in fewer, bigger chunks.
38c17a740b is described below

commit 38c17a740b542784695653db92542b4152296a1f
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Mon Jan 22 20:15:15 2024 +0000

    * tp/Texinfo/Convert/Plaintext.pm:
    When outputting a single newline, call _stream_output instead
    of _stream_output_encoded.  This reduces calls to _stream_byte_count
    to encode the output and allows output to be encoded in fewer,
    bigger chunks.
---
 ChangeLog                       |  8 ++++++++
 tp/Texinfo/Convert/Plaintext.pm | 12 ++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5355a5c08f..73e8457b2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-01-22  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/Convert/Plaintext.pm:
+       When outputting a single newline, call _stream_output instead
+       of _stream_output_encoded.  This reduces calls to _stream_byte_count
+       to encode the output and allows output to be encoded in fewer,
+       bigger chunks.
+
 2024-01-22  Gavin Smith <gavinsmith0123@gmail.com>
 
        Eliminate empty lines counting
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 0598a85ef1..6d0cf1bddd 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -1065,13 +1065,13 @@ sub _add_newline_if_needed($) {
     # NB \z matches end of string, whereas $ can match *before* a newline
     # at the end of a string.
     if ($1 ne "\n\n") {
-      _stream_output_encoded($self, "\n");
+      _stream_output($self, undef, "\n");
       _add_lines_count($self, 1);
     }
   } else {
     my $result = _stream_result($self);
     if ($result ne '' and $result ne "\n" and $result !~ /\n\n\z/) {
-      _stream_output_encoded($self, "\n");
+      _stream_output($self, undef, "\n");
       _add_lines_count($self, 1);
     }
   }
@@ -1741,7 +1741,7 @@ sub process_printindex($$;$)
   }
   pop @{$self->{'formatters'}};
 
-  _stream_output_encoded($self, "\n");
+  _stream_output($self, undef, "\n");
   _add_lines_count($self, 1);
 }
 
@@ -1781,7 +1781,7 @@ sub ensure_end_of_line($)
   return if !defined($result) or $result eq '';
 
   if (substr($result, -1) ne "\n") {
-    _stream_output_encoded($self, "\n");
+    _stream_output($self, undef, "\n");
     _add_lines_count($self, 1);
     $self->{'text_element_context'}->[-1]->{'counter'} = 0;
   }
@@ -1977,13 +1977,13 @@ sub _convert($$)
       if (defined($self->{'count_context'}->[-1]->{'pending_text'})
         and $self->{'count_context'}->[-1]->{'pending_text'} =~ /(..\z)/s) {
         if ($1 ne "\n\n") {
-          _stream_output_encoded($self, "\n");
+          _stream_output($self, undef, "\n");
           _add_lines_count($self, 1);
         }
       } else {
         my $result = _stream_result($self);
         if ($result ne '' and $result ne "\n" and $result !~ /\n\n\z/) {
-          _stream_output_encoded($self, "\n");
+          _stream_output($self, undef, "\n");
           _add_lines_count($self, 1);
         }
       }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]