projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
876f399
)
tracer/parser: use local vars in the iterator function
author
Stefan Sauer
<ensonic@users.sf.net>
Tue, 20 Dec 2016 08:25:30 +0000
(09:25 +0100)
committer
Stefan Sauer
<ensonic@users.sf.net>
Tue, 20 Dec 2016 08:25:30 +0000
(09:25 +0100)
This saves variable lookups in this thight loop.
tracer/tracer/parser.py
patch
|
blob
|
history
diff --git
a/tracer/tracer/parser.py
b/tracer/tracer/parser.py
index
ff05117
..
7c5c4eb
100644
(file)
--- a/
tracer/tracer/parser.py
+++ b/
tracer/tracer/parser.py
@@
-73,9
+73,11
@@
class Parser(object):
return self
def __next__(self):
+ log_regex = self.log_regex
+ data = self.data
while True:
- line = next(
self.
data)
- match =
self.
log_regex.match(line)
+ line = next(data)
+ match = log_regex.match(line)
if match:
g = list(match.groups())
g[Parser.F_PID] = int(g[Parser.F_PID])