Kaydet (Commit) 26b4f5be authored tarafından Noel Grandin's avatar Noel Grandin

java:use System.arrayCopy to copy arrays

instead of a for loop

Change-Id: I3fbd92c5f96970543c2da3843e54a733bf811e72
üst 9a541611
......@@ -1350,8 +1350,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
new com.sun.star.beans.PropertyValue[ nNumArgs + 1 ];
// copy current arguments
for ( int n = 0; n < nNumArgs; ++n )
aExtendedArguments[n] = aArguments[n];
System.arraycopy(aArguments, 0, aExtendedArguments, 0, nNumArgs);
// add new argument
aExtendedArguments[ nNumArgs ] = aArgument;
......
......@@ -218,9 +218,7 @@ public final class Loader {
return;
}
byte[] buf2 = new byte[2 * n];
for (int i = 0; i < n; ++i) {
buf2[i] = buf[i];
}
System.arraycopy(buf, 0, buf2, 0, n);
buf = buf2;
}
int k = s.read(buf, n, buf.length - n);
......
......@@ -82,11 +82,10 @@ public class _XBindableValue extends MultiMethodTest {
}
class MyValueBinding implements XValueBinding {
private Type[] TypeArray;
private final ArrayList<Type> types = new ArrayList<Type>();
public com.sun.star.uno.Type[] getSupportedValueTypes() {
return TypeArray;
return types.toArray(new Type[types.size()]);
}
public Object getValue(com.sun.star.uno.Type type)
......@@ -101,12 +100,6 @@ public class _XBindableValue extends MultiMethodTest {
public boolean supportsType(com.sun.star.uno.Type type) {
types.add(type);
TypeArray = new Type[types.size()];
for (int i = 0; i < types.size(); i++) {
TypeArray[i] = (Type) types.toArray()[i];
}
return true;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment