MCPcopy Create free account
hub / github.com/pmezard/go-difflib / RealQuickRatio

Method RealQuickRatio

difflib/difflib.go:509–512  ·  view source on GitHub ↗

Return an upper bound on ratio() very quickly. This isn't defined beyond that it is an upper bound on .Ratio(), and is faster to compute than either .Ratio() or .QuickRatio().

()

Source from the content-addressed store, hash-verified

507// This isn't defined beyond that it is an upper bound on .Ratio(), and
508// is faster to compute than either .Ratio() or .QuickRatio().
509func (m *SequenceMatcher) RealQuickRatio() float64 {
510 la, lb := len(m.a), len(m.b)
511 return calculateRatio(min(la, lb), la+lb)
512}
513
514// Convert range to the "ed" format
515func formatRangeUnified(start, stop int) string {

Callers 2

TestSequenceMatcherRatioFunction · 0.80

Calls 2

calculateRatioFunction · 0.85
minFunction · 0.85

Tested by 2

TestSequenceMatcherRatioFunction · 0.64