mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-10 18:15:58 +01:00
Optimize XmlStringBuilder.element() for the empty element case
For example RSM (XEP-0059) gives <before/> a different semantic as <before>UID</before>.
This commit is contained in:
parent
a3cf1ab0ca
commit
414d730962
1 changed files with 3 additions and 1 deletions
|
@ -75,7 +75,9 @@ public class XmlStringBuilder implements Appendable, CharSequence, Element {
|
|||
* @return the XmlStringBuilder
|
||||
*/
|
||||
public XmlStringBuilder element(String name, String content) {
|
||||
assert content != null;
|
||||
if (content.isEmpty()) {
|
||||
return emptyElement(name);
|
||||
}
|
||||
openElement(name);
|
||||
escape(content);
|
||||
closeElement(name);
|
||||
|
|
Loading…
Reference in a new issue