writeIterable method

void writeIterable(
  1. Iterable<XmlNode> nodes, [
  2. String? separator
])

Implementation

void writeIterable(Iterable<XmlNode> nodes, [String? separator]) {
  final iterator = nodes.iterator;
  if (iterator.moveNext()) {
    if (separator == null || separator.isEmpty) {
      do {
        iterator.current.accept(this);
      } while (iterator.moveNext());
    } else {
      iterator.current.accept(this);
      while (iterator.moveNext()) {
        buffer.write(separator);
        iterator.current.accept(this);
      }
    }
  }
}