MCPcopy Create free account
hub / github.com/cogentcore/core / prepareFilesToDiff

Function prepareFilesToDiff

texteditor/difflib/bytes/bytes_test.go:478–491  ·  view source on GitHub ↗
(count, seed int)

Source from the content-addressed store, hash-verified

476}
477
478func prepareFilesToDiff(count, seed int) (As, Bs [][][]byte) {
479 defer runtime.GC()
480 aux := func() { // to ensure temp variables go out of scope
481 stringsA, stringsB := tester.PrepareStringsToDiff(count, seed)
482 As = make([][][]byte, len(stringsA))
483 Bs = make([][][]byte, len(stringsB))
484 for i := range As {
485 As[i] = stringsToBytes(stringsA[i]...)
486 Bs[i] = stringsToBytes(stringsB[i]...)
487 }
488 }
489 aux()
490 return
491}
492
493func BenchmarkDiffer(b *testing.B) {
494 A, B := prepareFilesToDiff(b.N, 0)

Callers 2

BenchmarkDifferFunction · 0.70
BenchmarkMatcherFunction · 0.70

Calls 2

PrepareStringsToDiffFunction · 0.92
stringsToBytesFunction · 0.85

Tested by

no test coverage detected