Message9957

Author jmadden
Recipients jmadden, stefan.richthofer
Date 2015-04-24.17:26:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429896413.82.0.836697264617.issue2337@psf.upfronthosting.co.za>
In-reply-to
Content
If `PyDequeIter` needs to be sure to traverse all the way around the ring, then starting with `lastReturned` is really only a small optimization for the (rare?) case that nodes ahead of it return 0 but it and nodes behind it don't. Right?

So in that case, why not simply have its traverse method just call PyDeque's implementation?

        @Override
        public int traverse(Visitproc visit, Object arg) {
            int retVal = super.traverse(visit, arg);
            if (retVal != 0) {
                return retVal;
            }
            return PyDeque.this.traverse(visit, arg);
        }

That can potentially slightly simplify `traverseNode` again, or just move it all into `traverse`.

I think I agree with you about the null checks, so long as the lock is held. I don't know what to think about deadlocks, though; I don't see any obvious ones but I don't know enough about how/when this gets called.
History
Date User Action Args
2015-04-24 17:26:53jmaddensetmessageid: <1429896413.82.0.836697264617.issue2337@psf.upfronthosting.co.za>
2015-04-24 17:26:53jmaddensetrecipients: + jmadden, stefan.richthofer
2015-04-24 17:26:53jmaddenlinkissue2337 messages
2015-04-24 17:26:53jmaddencreate