summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2017-10-31 08:30:38 -0600
committerKarl Williamson <khw@cpan.org>2017-11-06 12:50:05 -0700
commitb59bf0b2884b21b6f3ce5eca607ab7a6096d87f5 (patch)
tree8f7f056070732c24842887baa1d18b6a54a9f7d1 /numeric.c
parentc8b388b0c776dab4a28db03739aff4d64daccada (diff)
downloadperl-b59bf0b2884b21b6f3ce5eca607ab7a6096d87f5.tar.gz
Use memEQs, memNEs in core files
Where the length is known, we can use these functions which relieve the programmer and the program reader from having to count characters. The memFOO functions should also be slightly faster than the strFOO equivalents. In some instances in this commit, hard coded numbers are used. These come from the 'case' statement values that apply to them.
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index 6821114f70..7514b748ff 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1013,7 +1013,7 @@ Perl_grok_number_flags(pTHX_ const char *pv, STRLEN len, UV *valuep, U32 flags)
s++;
if (s >= send)
return numtype;
- if (len == 10 && _memEQs(pv, "0 but true")) {
+ if (memEQs(pv, len, "0 but true")) {
if (valuep)
*valuep = 0;
return IS_NUMBER_IN_UV;