I have to execute this line of cose several million times, I wonder if there is a way to optimize it (maybe precomputing something?).
a.contains(b) || b.contains(a)
Thank you
edit: the code executed by the contains method already checks for a.length < b.length.
public static int indexOf(byte[] value, int valueCount, byte[] str, int strCount, int fromIndex) {
byte first = str[0];
int max = (valueCount - strCount);
for (int i = fromIndex; i <= max; i++) {
[...]
}
return -1;
}