diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-15 08:49:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-15 08:51:14 +0200 |
commit | c3c4ae5fdac0341f01eeed8d5c633d203eed8b2a (patch) | |
tree | 8fee07cdabdb5fb8e1597a88983c79bd8512ae3c /compilerplugins/clang/unnecessaryvirtual.py | |
parent | 6df2c90c08b67b943022286e7152b51d52e0ef5e (diff) |
use split() to simplify loplugin python code
Change-Id: Ib6d7acf54ca6c12a3b096435f8a621244df88b4f
Diffstat (limited to 'compilerplugins/clang/unnecessaryvirtual.py')
-rwxr-xr-x | compilerplugins/clang/unnecessaryvirtual.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/compilerplugins/clang/unnecessaryvirtual.py b/compilerplugins/clang/unnecessaryvirtual.py index cd5613771244..ee7d9ec928af 100755 --- a/compilerplugins/clang/unnecessaryvirtual.py +++ b/compilerplugins/clang/unnecessaryvirtual.py @@ -9,15 +9,12 @@ overridingSet = set() with io.open("loplugin.unnecessaryvirtual.log", "rb", buffering=1024*1024) as txt: for line in txt: - - if line.startswith("definition:\t"): - idx1 = line.find("\t") - clazzName = line[idx1+1 : len(line)-1] + tokens = line.strip().split("\t") + if tokens[0] == "definition:": + clazzName = tokens[1] definitionSet.add(clazzName) - - elif line.startswith("overriding:\t"): - idx1 = line.find("\t") - clazzName = line[idx1+1 : len(line)-1] + elif tokens[0] == "overriding:": + clazzName = tokens[1] overridingSet.add(clazzName) with open("loplugin.unnecessaryvirtual.report", "wt") as f: |