This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b45732d
)
Refactor B::hash to use Perl_newSVpvf() instead of my_sprintf() and new_SVpvn*.
author
Nicholas Clark
<nick@ccl4.org>
Sun, 24 Oct 2010 14:23:05 +0000
(16:23 +0200)
committer
Nicholas Clark
<nick@ccl4.org>
Sun, 24 Oct 2010 14:23:05 +0000
(16:23 +0200)
ext/B/B.xs
patch
|
blob
|
blame
|
history
diff --git
a/ext/B/B.xs
b/ext/B/B.xs
index
138ec05
..
28ad952
100644
(file)
--- a/
ext/B/B.xs
+++ b/
ext/B/B.xs
@@
-781,11
+781,9
@@
hash(sv)
CODE:
STRLEN len;
U32 hash = 0;
- char hexhash[19]; /* must fit "0xffffffffffffffff" plus trailing \0 */
const char *s = SvPV(sv, len);
PERL_HASH(hash, s, len);
- len = my_sprintf(hexhash, "0x%"UVxf, (UV)hash);
- ST(0) = newSVpvn_flags(hexhash, len, SVs_TEMP);
+ ST(0) = sv_2mortal(Perl_newSVpvf(aTHX_ "0x%"UVxf, (UV)hash));
#define cast_I32(foo) (I32)foo
IV