mirror of
https://github.com/corda/corda.git
synced 2025-01-16 17:59:46 +00:00
Fix System.arraycopy when the source and dest are the same
This commit is contained in:
parent
101b0c3b0e
commit
2ae6aa7ddf
@ -70,7 +70,7 @@ public class ArrayList<T> implements List<T> {
|
||||
public void add(int index, T element) {
|
||||
size = Math.max(size+1, index+1);
|
||||
grow();
|
||||
System.arraycopy(array, index, array, index+1, size-index);
|
||||
System.arraycopy(array, index, array, index+1, size-index-1);
|
||||
array[index] = element;
|
||||
}
|
||||
|
||||
|
@ -446,7 +446,7 @@ Java_java_lang_System_arraycopy
|
||||
{
|
||||
uint8_t* sbody = &cast<uint8_t>(s, 2 * BytesPerWord);
|
||||
uint8_t* dbody = &cast<uint8_t>(d, 2 * BytesPerWord);
|
||||
if (src == dst) {
|
||||
if (s == d) {
|
||||
memmove(dbody + (dstOffset * elementSize),
|
||||
sbody + (srcOffset * elementSize),
|
||||
length * elementSize);
|
||||
|
Loading…
Reference in New Issue
Block a user