From: Vincent Pit Date: Mon, 23 Aug 2010 10:39:22 +0000 (+0200) Subject: Get rid of indirect_is_indirect X-Git-Tag: v0.23~4 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=commitdiff_plain;h=e3609d4f5df9ec09d582f3e60b92e6e8263cd6cd Get rid of indirect_is_indirect Its check is redundant and not decisive at all. --- diff --git a/indirect.xs b/indirect.xs index 9a2b6c0..dedc58b 100644 --- a/indirect.xs +++ b/indirect.xs @@ -700,16 +700,6 @@ done: /* ... ck_entersub ......................................................... */ -STATIC int indirect_is_indirect(const indirect_op_info_t *moi, const indirect_op_info_t *ooi) { - if (moi->pos > ooi->pos) - return 0; - - if (moi->pos == ooi->pos) - return moi->len == ooi->len && !memcmp(moi->buf, ooi->buf, moi->len); - - return 1; -} - STATIC OP *(*indirect_old_ck_entersub)(pTHX_ OP *) = 0; STATIC OP *indirect_ck_entersub(pTHX_ OP *o) { @@ -759,7 +749,10 @@ STATIC OP *indirect_ck_entersub(pTHX_ OP *o) { if (!ooi) goto done; - if (indirect_is_indirect(moi, ooi)) { + /* When positions are identical, the method and the object must have the + * same name. But it also means that it is an indirect call, as "foo->foo" + * results in different positions. */ + if (moi->pos <= ooi->pos) { SV *file; dSP;