[gimp] tools: in performance-log-viewer.py, fix "function()" predicate ...



commit 84227fbfec87101ff83f94da01df37c211594e75
Author: Ell <ell_se yahoo com>
Date:   Sat Nov 10 02:51:07 2018 -0500

    tools: in performance-log-viewer.py, fix "function()" predicate ...
    
    ... when not specifying a thread-ID

 tools/performance-log-viewer.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/tools/performance-log-viewer.py b/tools/performance-log-viewer.py
index db934a5983..adc5871ac9 100755
--- a/tools/performance-log-viewer.py
+++ b/tools/performance-log-viewer.py
@@ -727,12 +727,13 @@ class FindSamplesPopover (Gtk.Popover):
         for i in range (len (samples)):
             try:
                 def match_thread (thread, id, state = None):
-                    return (type (id) == int                and \
-                            id == thread.id)                or  \
-                           (type (id) == str                and \
-                            thread.name                     and \
-                            re.fullmatch (id, thread.name)) and \
-                           (state is None                   or  \
+                    return (id is None or                         \
+                            (type (id) == int                 and \
+                             id == thread.id)                 or  \
+                            (type (id) == str                 and \
+                             thread.name                      and \
+                             re.fullmatch (id, thread.name))) and \
+                           (state is None                     or  \
                             re.fullmatch (state, str (thread.state)))
 
                 def thread (id, state = None):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]