In InterpolatedVar.cs, changed by 1348c82:
private int WrapRange(int i) {
return MathLib.Modulo(i, maxElement); // TODO: Why does -1 get passed here sometimes. We shouldn't have to change this to accomodate.
}
This should actually be
return (i >= maxElement) ? (i - maxElement) : i;
But for some reason, i coming in can sometimes be -1 when coming from here:
public ref T this[int i] {
get {
Assert(IsIdxValid(i));
i += firstElement;
i = WrapRange(i);
return ref elements![i];
}
}
There is a check for this (IsIdxValid), but it's just an assert. This must be some bug in my implementation I would imagine, but further research is needed. For now, the modulo works with an occasional hiccup.
In InterpolatedVar.cs, changed by 1348c82:
This should actually be
But for some reason, i coming in can sometimes be -1 when coming from here:
There is a check for this (IsIdxValid), but it's just an assert. This must be some bug in my implementation I would imagine, but further research is needed. For now, the modulo works with an occasional hiccup.