filter_openocd: Prefer high repetitions.
I'd rather see "these 10 lines were repeated 100 times" than "these 100 lines were repeated 10 times." Change-Id: I88fcf86b10c5fb0ba1d19b21fe054065da90fedd Signed-off-by: Tim Newsome <tim@sifive.com>
This commit is contained in:
parent
4270857a76
commit
bed28d5ec7
|
@ -50,7 +50,7 @@ def shorten_buffer(outfd, buf, current_repetition):
|
|||
repetitions.append((matched_lines + length, length))
|
||||
|
||||
if repetitions:
|
||||
repetitions.sort(key=lambda entry: (entry[0] * (entry[1] / entry[0]), -entry[1]))
|
||||
repetitions.sort(key=lambda entry: -entry[1])
|
||||
matched_lines, length = repetitions[-1]
|
||||
repeated = int(matched_lines / length)
|
||||
if repeated * length >= 3:
|
||||
|
|
Loading…
Reference in New Issue