SOLR-619 -- switch to System.arraycopy() for array copy

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@678096 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan McKinley 2008-07-19 04:21:20 +00:00
parent bed156e2e1
commit 3c33837cbd
1 changed files with 4 additions and 8 deletions

View File

@ -689,14 +689,10 @@ public final class IndexSchema {
dynamicCopyFields = new DynamicCopy[] {dcopy};
}
else {
int i=0;
DynamicCopy[] old = dynamicCopyFields;
dynamicCopyFields = new DynamicCopy[dynamicCopyFields.length+1];
for( DynamicCopy dc : old ) {
dynamicCopyFields[i++] = dc;
}
dynamicCopyFields[i++] = dcopy;
old = null;
DynamicCopy[] temp = new DynamicCopy[dynamicCopyFields.length+1];
System.arraycopy(dynamicCopyFields,0,temp,0,dynamicCopyFields.length);
temp[temp.length -1] = dcopy;
dynamicCopyFields = temp;
}
log.finest("Dynamic Copy Field:" + dcopy );
}