mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Reorganized megabuf a bit.
This commit is contained in:
parent
fd4e94220f
commit
613f3884d4
@ -281,28 +281,32 @@ public final class Functions {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static double getBufferItem(final Map<Integer, double[]> megabuf, final int index) {
|
||||||
|
return getSubBuffer(megabuf, index & ~1023)[index & 1023];
|
||||||
|
}
|
||||||
|
|
||||||
|
private static double setBufferItem(final Map<Integer, double[]> megabuf, final int index, double value) {
|
||||||
|
return getSubBuffer(megabuf, index & ~1023)[index & 1023] = value;
|
||||||
|
}
|
||||||
|
|
||||||
@Dynamic
|
@Dynamic
|
||||||
public static final double gmegabuf(RValue index) throws EvaluationException {
|
public static final double gmegabuf(RValue index) throws EvaluationException {
|
||||||
final int intIndex = (int) index.getValue();
|
return getBufferItem(gmegabuf, (int) index.getValue());
|
||||||
return getSubBuffer(gmegabuf, intIndex & ~1023)[intIndex & 1023];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Dynamic
|
@Dynamic
|
||||||
public static final double gmegabuf(RValue index, double value) throws EvaluationException {
|
public static final double gmegabuf(RValue index, double value) throws EvaluationException {
|
||||||
final int intIndex = (int) index.getValue();
|
return setBufferItem(gmegabuf, (int) index.getValue(), value);
|
||||||
return getSubBuffer(gmegabuf, intIndex & ~1023)[intIndex & 1023] = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Dynamic
|
@Dynamic
|
||||||
public static final double megabuf(RValue index) throws EvaluationException {
|
public static final double megabuf(RValue index) throws EvaluationException {
|
||||||
final int intIndex = (int) index.getValue();
|
return getBufferItem(Expression.getInstance().getMegabuf(), (int) index.getValue());
|
||||||
return getSubBuffer(Expression.getInstance().getMegabuf(), intIndex & ~1023)[intIndex & 1023];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Dynamic
|
@Dynamic
|
||||||
public static final double megabuf(RValue index, double value) throws EvaluationException {
|
public static final double megabuf(RValue index, double value) throws EvaluationException {
|
||||||
final int intIndex = (int) index.getValue();
|
return setBufferItem(Expression.getInstance().getMegabuf(), (int) index.getValue(), value);
|
||||||
return getSubBuffer(Expression.getInstance().getMegabuf(), intIndex & ~1023)[intIndex & 1023] = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user