[#5973] Copy constructor performance optimisation

This commit is contained in:
lukaseder 2017-03-16 12:47:50 +01:00
parent 1c4732b321
commit e3c991176a
2 changed files with 23 additions and 5 deletions

View File

@ -77,6 +77,7 @@ public final class JSONFormat {
false,
"\n",
2,
null,
true,
RecordFormat.ARRAY
);
@ -86,13 +87,14 @@ public final class JSONFormat {
boolean format,
String newline,
int indent,
String[] indented,
boolean header,
RecordFormat recordFormat
) {
this.format = format;
this.newline = newline;
this.indent = indent;
this.indented = new String[] {
this.indented = indented != null ? indented : new String[] {
"",
format ? rightPad("", indent * 1) : "",
format ? rightPad("", indent * 2) : "",
@ -110,8 +112,10 @@ public final class JSONFormat {
newFormat,
newline,
indent,
null,
header,
recordFormat);
recordFormat
);
}
/**
@ -129,6 +133,7 @@ public final class JSONFormat {
format,
newNewline,
indent,
indented,
header,
recordFormat
);
@ -149,6 +154,7 @@ public final class JSONFormat {
format,
newline,
newIndent,
null,
header,
recordFormat
);
@ -182,8 +188,10 @@ public final class JSONFormat {
format,
newline,
indent,
indented,
newHeader,
recordFormat);
recordFormat
);
}
/**
@ -203,8 +211,10 @@ public final class JSONFormat {
format,
newline,
indent,
indented,
header,
newRecordFormat);
newRecordFormat
);
}
/**

View File

@ -60,6 +60,7 @@ public final class XMLFormat {
false,
"\n",
2,
null,
true,
RecordFormat.VALUE_ELEMENTS_WITH_FIELD_ATTRIBUTE
);
@ -70,6 +71,7 @@ public final class XMLFormat {
boolean format,
String newline,
int indent,
String[] indented,
boolean header,
RecordFormat recordFormat
) {
@ -77,7 +79,7 @@ public final class XMLFormat {
this.format = format;
this.newline = newline;
this.indent = indent;
this.indented = new String[] {
this.indented = indented != null ? indented : new String[] {
"",
format ? rightPad("", indent * 1) : "",
format ? rightPad("", indent * 2) : "",
@ -96,6 +98,7 @@ public final class XMLFormat {
format,
newline,
indent,
indented,
header,
recordFormat
);
@ -117,6 +120,7 @@ public final class XMLFormat {
newFormat,
newline,
indent,
null,
header,
recordFormat
);
@ -138,6 +142,7 @@ public final class XMLFormat {
format,
newNewline,
indent,
indented,
header,
recordFormat
);
@ -159,6 +164,7 @@ public final class XMLFormat {
format,
newline,
newIndent,
null,
header,
recordFormat
);
@ -198,6 +204,7 @@ public final class XMLFormat {
format,
newline,
indent,
indented,
newHeader,
recordFormat
);
@ -220,6 +227,7 @@ public final class XMLFormat {
format,
newline,
indent,
indented,
header,
newRecordFormat
);