Branch: refs/heads/blead
Home: https://github.com/Perl/perl5
Commit: ed11e4914f4153bab9c11bf670acce177bf111b2
https://github.com/Perl/perl5/commit/ed11e4914f4153bab9c11bf670acce177bf111b2
Author: Richard Leach <[email protected]>
Date: 2026-08-23 (Sun, 23 Aug 2026)
Changed paths:
M regexec.c
Log Message:
-----------
S_reg_set_capture_string - avoid redundant work when COWing
When saving a pointer to the just-matched string and copying the string,
`S_reg_set_capture_string` has a COW branch and a non-COW branch. Some
common code follows the two branches:
```
RXp_SUBCOFFSET(prog) = RXp_SUBOFFSET(prog);
if (RXp_SUBOFFSET(prog) && utf8_target) {
....
}
```
However, the COW branch concludes with:
```
RXp_SUBOFFSET(prog) = 0;
RXp_SUBCOFFSET(prog) = 0;
```
Since the common code cannot achieve anything in the COW case,
this commit moves it inside the non-COW branch.
To unsubscribe from these emails, change your notification settings at
https://github.com/Perl/perl5/settings/notifications