toke.c: Remove unnecessary SvRV null check
authorFather Chrysostomos <sprout@cpan.org>
Tue, 5 Nov 2013 05:52:55 +0000 (21:52 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 5 Nov 2013 14:15:15 +0000 (06:15 -0800)
If SvROK is true, then SvRV will never be null.  (If it is, then
serious problems will occur elsewhere, as other code assumes this.)

toke.c

diff --git a/toke.c b/toke.c
index bd65fd3..08421ff 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -2866,8 +2866,8 @@ S_get_and_check_backslash_N_name(pTHX_ const char* s, const char* const e)
      * validation. */
     table = GvHV(PL_hintgv);            /* ^H */
     cvp = hv_fetchs(table, "charnames", FALSE);
-    if (cvp && (cv = *cvp) && SvROK(cv) && ((rv = SvRV(cv)) != NULL)
-        && SvTYPE(rv) == SVt_PVCV && ((stash = CvSTASH(rv)) != NULL))
+    if (cvp && (cv = *cvp) && SvROK(cv) && (rv = SvRV(cv),
+        SvTYPE(rv) == SVt_PVCV) && ((stash = CvSTASH(rv)) != NULL))
     {
         const char * const name = HvNAME(stash);
         if strEQ(name, "_charnames") {