From 606d0d6769e77d039372ebaee1cc88dabc41b1f3 Mon Sep 17 00:00:00 2001 From: Carsten Grohmann Date: Tue, 3 Dec 2019 06:54:27 +0100 Subject: [PATCH] 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. --- OOMAnalyser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OOMAnalyser.py b/OOMAnalyser.py index 3311687..3ff3311 100644 --- a/OOMAnalyser.py +++ b/OOMAnalyser.py @@ -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