I am inclusive <3

This commit is contained in:
Olof Larsson 2016-03-09 23:29:06 +01:00
parent c4fbd81a26
commit bc1e4351f9

View File

@ -255,11 +255,12 @@ public class InventoryAdapter implements JsonDeserializer<Inventory>, JsonSerial
// -------------------------------------------- //
// This is a modified copyOfRange implementation.
// Both boundaries are inclusive.
// It returns the original when possible.
public static <T> T[] range(T[] original, int from, int to)
{
if (from == 0 && to == original.length - 1) return original;
return Arrays.copyOfRange(original, from, to);
return Arrays.copyOfRange(original, from, to + 1);
}
}