Skip to content

Commit b829c69

Browse files
committed
class.c: Avoid UTF8SKIPs
This value is now returned from the isSPACE_utf8_safe macro. Use it instead of re-deriving it.
1 parent 7681e1f commit b829c69

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

class.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,9 @@ static const char *S_split_package_ver(pTHX_ SV *value, SV *pkgname, SV *pkgvers
445445
if(SvUTF8(value))
446446
SvUTF8_on(pkgname);
447447

448-
while(*p && isSPACE_utf8_safe(p, end))
449-
p += UTF8SKIP(p);
448+
Size_t advance;
449+
while(*p && (advance = isSPACE_utf8_safe(p, end)))
450+
p += advance;
450451

451452
if(*p) {
452453
/* scan_version() gets upset about trailing content. We need to extract
@@ -463,8 +464,8 @@ static const char *S_split_package_ver(pTHX_ SV *value, SV *pkgname, SV *pkgvers
463464
scan_version(SvPVX(tmpsv), pkgversion, FALSE);
464465
}
465466

466-
while(*p && isSPACE_utf8_safe(p, end))
467-
p += UTF8SKIP(p);
467+
while(*p && (advance = isSPACE_utf8_safe(p, end)))
468+
p += advance;
468469

469470
return p;
470471
}

0 commit comments

Comments
 (0)