Bläddra i källkod

fix unnecessary thread creates

David Rose 19 år sedan
förälder
incheckning
1411ac870b
1 ändrade filer med 5 tillägg och 4 borttagningar
  1. 5 4
      panda/src/pstatclient/pStatThread.I

+ 5 - 4
panda/src/pstatclient/pStatThread.I

@@ -59,11 +59,12 @@ PStatThread(Thread *thread, PStatClient *client) {
   int thread_index = thread->get_pstats_index();
   if (thread_index != -1) {
     (*this) = PStatThread(client, thread_index);
-  }
 
-  // This is the first time we have encountered this current Thread.
-  // Make a new PStatThread object for it.
-  (*this) = client->make_thread(thread);
+  } else {
+    // This is the first time we have encountered this current Thread.
+    // Make a new PStatThread object for it.
+    (*this) = client->make_thread(thread);
+  }
 #else
   _client = (PStatClient *)NULL;
   _index = 0;