For a negative index one conditional is redundant, since after determining
that key < 0 and recomputing key as (AvFILLp(av) - key), key can't
be > AvFILLp(av).
key += AvFILLp(av) + 1;
if (key < 0)
return NULL;
key += AvFILLp(av) + 1;
if (key < 0)
return NULL;
+ assert(key <= AvFILLp(av));
+ if (!AvARRAY(av)[key])
+ goto emptyness;
-
- if (key > AvFILLp(av) || !AvARRAY(av)[key]) {
+ else if (key > AvFILLp(av) || !AvARRAY(av)[key]) {
emptyness:
return lval ? av_store(av,key,newSV(0)) : NULL;
}
emptyness:
return lval ? av_store(av,key,newSV(0)) : NULL;
}