develooper Front page | perl.perl5.changes | Postings from November 2010

[perl.git] branch blead, updated. v5.13.7-202-g31b05a0

From:
Florian Ragwitz
Date:
November 30, 2010 02:45
Subject:
[perl.git] branch blead, updated. v5.13.7-202-g31b05a0
Message ID:
E1PNNhw-0005jB-If@camel.ams6.corp.booking.com
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/31b05a0f9f5158b8f1340a8e92be562574510792?hp=10533aceddca633dc790cac997abdf25175ed2c8>

- Log -----------------------------------------------------------------
commit 31b05a0f9f5158b8f1340a8e92be562574510792
Author: Florian Ragwitz <rafl@debian.org>
Date:   Tue Nov 30 10:24:26 2010 +0100

    Eliminate strlen and strEQ usage in gv_fetchmethod
    
    This commit brought to you with the aid of the campaign for elimination of
    strlen().
-----------------------------------------------------------------------

Summary of changes:
 gv.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/gv.c b/gv.c
index 4775bcc..9cfc70d 100644
--- a/gv.c
+++ b/gv.c
@@ -722,11 +722,12 @@ Perl_gv_fetchmethod_flags(pTHX_ HV *stash, const char *name, U32 flags)
 		 * a filehandle. If IO:File has not been loaded, try to
 		 * require it first instead of croaking */
 		const char *stash_name = HvNAME_get(stash);
-		const char *io_file = "IO/File.pm";
-		if (stash_name && strEQ(stash_name,"IO::File")
-		    && ! hv_exists(GvHVn(PL_incgv),io_file, strlen(io_file))
+		if (stash_name && memEQs(stash_name, HvNAMELEN_get(stash), "IO::File")
+		    && !Perl_hv_common(aTHX_ GvHVn(PL_incgv), NULL,
+				       STR_WITH_LEN("IO/File.pm"), 0,
+				       HV_FETCH_ISEXISTS, NULL, 0)
 		) {
-		    require_pv(io_file);
+		    require_pv("IO/File.pm");
 		    gv = gv_fetchmeth(stash, name, nend - name, 0);
 		    if (gv)
 			return gv;

--
Perl5 Master Repository



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About