Use negative slicing with operator overloading

Positive numbers in slices works well, but for negative numbers you
have to activate operator overloading. This has a (unknown) speed
penalty.
This commit is contained in:
Carsten Grohmann 2019-12-03 06:54:27 +01:00
parent dfcbe56fa6
commit 606d0d6769

View File

@ -189,8 +189,8 @@ class OOMEntity(object):
continue
if cols_to_strip:
elements = line.split(" ", cols_to_strip)
line = elements.pop(-1)
# [-1] slicing needs Transcrypt operator overloading
line = line.split(" ", cols_to_strip)[-1] # __:opov
# OOMs logged to /var/log/messages / journalctl may contain
# "kernel:" at the begin of the content