This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
S_require_file() : simplify an else if block
authorDavid Mitchell <davem@iabyn.com>
Thu, 13 Apr 2017 10:53:35 +0000 (11:53 +0100)
committerDavid Mitchell <davem@iabyn.com>
Tue, 18 Apr 2017 11:58:32 +0000 (12:58 +0100)
change

    if (...) {
        ...
    }
    else {
      if (...) {
        ...
      }
    }
to

    if (...) {
        ...
    }
    else if (...) {
        ...
    }

Should make no functional difference

pp_ctl.c

index f747000..072f529 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3997,8 +3997,9 @@ S_require_file(pTHX_ SV *sv)
                        filter_sub = NULL;
                    }
                }
-               else {
-                 if (path_searchable) {
+               else if (path_searchable) {
+                    /* match against a plain @INC element (non-searchable
+                     * paths are only matched against refs in @INC) */
                    const char *dir;
                    STRLEN dirlen;
 
@@ -4078,7 +4079,6 @@ S_require_file(pTHX_ SV *sv)
                          */
                         break;
                     }
-                 }
                }
            }
        }