Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 5a979ea5f855c8fa705f8700e6e3f8d8c7b0286c
      
https://github.com/Perl/perl5/commit/5a979ea5f855c8fa705f8700e6e3f8d8c7b0286c
  Author: Karl Williamson <k...@cpan.org>
  Date:   2024-10-21 (Mon, 21 Oct 2024)

  Changed paths:
    M utf8.c

  Log Message:
  -----------
  bytes_from_utf8_loc: Move declarations, rename variable

Now that we have c99, we can declare close to first use.  s0 seems to be
the more common name for a variable that preserves the position a string
's' had on input.  This also adds a const to make sure the function
doesn't change s0.


  Commit: 83c2748b31171c78b500b558efb351980951d92b
      
https://github.com/Perl/perl5/commit/83c2748b31171c78b500b558efb351980951d92b
  Author: Karl Williamson <k...@cpan.org>
  Date:   2024-10-21 (Mon, 21 Oct 2024)

  Changed paths:
    M utf8.c

  Log Message:
  -----------
  bytes_from_utf8: Copy initial invariants as-is

The paradigm used in this commit is in place in several other places in
core.  When dealing with UTF-8, it may well be that the first part of a
string contains only characters that are the same when encoded as UTF-8
as when not.  There is a function that finds the first position in a
string not like that.  It works on a whole word at a time instead of
per-byte, effectively speeding things up by a factor of 8.

In this case, calling that function tells us that we can use memcpy() to
do the initial part of our task, before having to switch to looking at
individual bytes.


Compare: https://github.com/Perl/perl5/compare/060589f9e660...83c2748b3117

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to