Message9957
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. |
|
Date |
User |
Action |
Args |
2015-04-24 17:26:53 | jmadden | set | messageid: <1429896413.82.0.836697264617.issue2337@psf.upfronthosting.co.za> |
2015-04-24 17:26:53 | jmadden | set | recipients:
+ jmadden, stefan.richthofer |
2015-04-24 17:26:53 | jmadden | link | issue2337 messages |
2015-04-24 17:26:53 | jmadden | create | |
|