fix generating too many cleanup transactions. closes #506

This commit is contained in:
Kevin Jahns
2023-03-09 13:44:52 +01:00
parent 7e40fc442d
commit fe48efe64f
3 changed files with 29 additions and 3 deletions

View File

@@ -257,7 +257,8 @@ export class YXmlFragment extends AbstractType {
* @return {string} The string representation of all children.
*/
toString () {
return typeListMap(this, xml => xml.toString()).join('')
// toString can result in many cleanup transactions. We wrap all cleanup transactions here to reduce the work
return transact(/** @type {Doc} */ (this.doc), () => typeListMap(this, xml => xml.toString()).join(''))
}
/**