rteval: Use get instead of setdefault for calculating range
PATCH 1/1 rteval: Use get instead of setdefault for calculating range
As Crystal Wood <[email protected]> points out, there is no need to setdefault when calculating the range, just use get if there is no value.
Signed-off-by John Kacur <[email protected]>
--- rteval/modules/measurement/cyclictest.py | 2 +- rteval/modules/measurement/timerlat.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
rteval/modules/measurement/cyclictest.py +1 -1
@@ -115,7 +115,7 @@ class RunData: low = i break high = keys[-1] - while high and self.__samples.setdefault(high, 0) == 0: + while high and self.__samples.get(high, 0) == 0: high -= 1 self.__range = high - low
rteval/modules/measurement/timerlat.py +1 -1
@@ -106,7 +106,7 @@ class TLRunData: low = i break high = keys[-1] - while high and self.__samples.setdefault(high, 0) == 0: + while high and self.__samples.get(high, 0) == 0: high -= 1 self.__range = high - low
Signature · 1 line
2.44.0