Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: fd29c4c803281eb8066879eee9e77f042f189679
      
https://github.com/Perl/perl5/commit/fd29c4c803281eb8066879eee9e77f042f189679
  Author: Karl Williamson <k...@cpan.org>
  Date:   2024-02-05 (Mon, 05 Feb 2024)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Use strchr before strpbrk

Platforms that conform to the POSIX standard use a semi-colon here as a
separator.  But there are non-conforming platforms which causes our code
to look for any ASCII punctuation character instead, using strpbrk().

I looked at the glibc code for strpbrk, and it isn't that clever.
Looking for a single character with strchr() is faster.  It seems to me
that conforming platforms shouldn't be penalized, so this commit uses
strchr to look for semi-colons, and only if that isn't found does it
fall back to strpbrk.


Reply via email to