From: Nicholas Clark Date: Fri, 17 Mar 2006 20:39:47 +0000 (+0000) Subject: Remove a duplicated conditional test by putting everything for the X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cb9e20bb64f36b65e47caecca6cc3eb11c910175;p=p5sagit%2Fp5-mst-13.2.git Remove a duplicated conditional test by putting everything for the not readonly case inside one block. p4raw-id: //depot/perl@27537 --- diff --git a/sv.c b/sv.c index 5c4722d..d981d88 100644 --- a/sv.c +++ b/sv.c @@ -5297,13 +5297,14 @@ Perl_sv_len_utf8(pTHX_ register SV *sv) } else { ulen = Perl_utf8_length(aTHX_ s, s + len); - if (!mg && !SvREADONLY(sv)) { - sv_magic(sv, 0, PERL_MAGIC_utf8, 0, 0); - mg = mg_find(sv, PERL_MAGIC_utf8); - assert(mg); - } - if (mg) + if (!SvREADONLY(sv)) { + if (!mg) { + sv_magic(sv, 0, PERL_MAGIC_utf8, 0, 0); + mg = mg_find(sv, PERL_MAGIC_utf8); + assert(mg); + } mg->mg_len = ulen; + } } return ulen; }