From: Nicholas Clark Date: Mon, 29 Dec 2008 22:43:40 +0000 (+0000) Subject: In mro_get_mro, use the length and UTF-8-ness now contained in struct mro_alg X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fbb5a95cd7a2da48d68eadc01859bea9278f0eab;p=p5sagit%2Fp5-mst-13.2.git In mro_get_mro, use the length and UTF-8-ness now contained in struct mro_alg when generating an SV containing the name. --- diff --git a/ext/mro/mro.xs b/ext/mro/mro.xs index c9c9779..09ad83b 100644 --- a/ext/mro/mro.xs +++ b/ext/mro/mro.xs @@ -312,9 +312,14 @@ mro_get_mro(...) classname = ST(0); class_stash = gv_stashsv(classname, 0); - ST(0) = sv_2mortal(newSVpv(class_stash - ? HvMROMETA(class_stash)->mro_which->name - : "dfs", 0)); + if (class_stash) { + const struct mro_alg *const meta = HvMROMETA(class_stash)->mro_which; + ST(0) = newSVpvn_flags(meta->name, meta->length, + SVs_TEMP + | ((meta->kflags & HVhek_UTF8) ? SVf_UTF8 : 0)); + } else { + ST(0) = newSVpvn_flags("dfs", 3, SVs_TEMP); + } XSRETURN(1); void