[java] Update rule AvoidArrayLoops#3408
Conversation
Generated by 🚫 Danger |
table[i] = labels[offset + readInt(u)];That's not simply done by calling System.arraycopy. The array index on the rhs is calculated via readInt... and it is not based on i (so, no fixed offset)
S[i] = S[j];
S[j] = Si;Not so simple either. It's the same array - so the content is shifted. Not a use case for Arrays.copyOf...
for (int i=0; i<time.length; i++) {
blob[8+time.length-i-1] = time[i];
}I think, that's actually correct. This could indeed be rewritten as:
There are two for-loops. I guess, we detected the inner loop, but for some reason, we reported the outer loop. The copy might be
for (int i = 0; i < uVlen; i++) {
int nextp = a[headp];
a[headp] = uValues[i];
headp = nextp;
}for the array assignment on the lhs the loop index is not used.
for (int i = srcBegin + (1 >> LO_BYTE_SHIFT); i < srcEnd; i += 2) {
dst[dstBegin++] = value[i];
}Update: These cases are now fixed ✔️ |
Describe the PR