mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 12:02:05 +01:00
XmlStringBuilder: Use potential length for target StringBuilder
This commit is contained in:
parent
fb3a71a14d
commit
8086a11c6c
1 changed files with 3 additions and 1 deletions
|
@ -628,7 +628,9 @@ public class XmlStringBuilder implements Appendable, CharSequence, Element {
|
|||
|
||||
@Override
|
||||
public CharSequence toXML(XmlEnvironment enclosingXmlEnvironment) {
|
||||
StringBuilder res = new StringBuilder();
|
||||
// This is only the potential length, since the actual length depends on the given XmlEnvironment.
|
||||
int potentialLength = length();
|
||||
StringBuilder res = new StringBuilder(potentialLength);
|
||||
try {
|
||||
appendXmlTo(res, enclosingXmlEnvironment);
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Reference in a new issue