pub fn addBundleAsRoots(wip: *Wip, other: ErrorBundle) !void wip: *Wipother: ErrorBundle485
486
487
488
489
490
491
492
493
494
495
496
497
498 pub fn addBundleAsRoots(wip: *Wip, other: ErrorBundle) !void {
const gpa = wip.gpa;
try wip.string_bytes.ensureUnusedCapacity(gpa, other.string_bytes.len);
try wip.extra.ensureUnusedCapacity(gpa, other.extra.len);
const other_list = other.getMessages();
try wip.root_list.ensureUnusedCapacity(gpa, other_list.len);
for (other_list) |other_msg| {
// The ensureUnusedCapacity calls above guarantees this.
wip.root_list.appendAssumeCapacity(wip.addOtherMessage(other, other_msg) catch unreachable);
}
}