| 661 | } |
| 662 | |
| 663 | func (d *Differ) Dump(tag []byte, x [][]byte, low int, high int) (out [][]byte) { |
| 664 | // Generate comparison results for a same-tagged range. |
| 665 | sout := d.StructuredDump(tag[0], x, low, high) |
| 666 | out = make([][]byte, len(sout)) |
| 667 | var bld bytes.Buffer |
| 668 | bld.Grow(1024) |
| 669 | for i, line := range sout { |
| 670 | bld.Reset() |
| 671 | bld.WriteByte(line.Tag) |
| 672 | bld.Write(SPACE) |
| 673 | bld.Write(line.Line) |
| 674 | out[i] = append(out[i], bld.Bytes()...) |
| 675 | } |
| 676 | return out |
| 677 | } |
| 678 | |
| 679 | func (d *Differ) PlainReplace(a [][]byte, alo int, ahi int, b [][]byte, blo int, bhi int) (out [][]byte, err error) { |
| 680 | if !(alo < ahi) || !(blo < bhi) { // assertion |