diff mbox series

[08/34] kernelshark: Use lambda parameter instead of captured local variable

Message ID 20240114171723.14092-9-dev@benjarobin.fr (mailing list archive)
State Accepted
Commit b1141917992df603a5f6d8ba87eed1323dec59c7
Headers show
Series Fix kernelshark issues introduced by the migration to Qt6 | expand

Commit Message

Benjamin ROBIN Jan. 14, 2024, 5:16 p.m. UTC
In KsGLWidget::_find(), fix lamFindEntryByCPU() and lamFindEntryByPid()
which had a parameter "b": use it instead of using captured "bin"
local variable.

Signed-off-by: Benjamin ROBIN <dev@benjarobin.fr>
---
 src/KsGLWidget.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/src/KsGLWidget.cpp b/src/KsGLWidget.cpp
index 23485d2..dd9f41a 100644
--- a/src/KsGLWidget.cpp
+++ b/src/KsGLWidget.cpp
@@ -986,15 +986,15 @@  bool KsGLWidget::_find(int bin, int sd, int cpu, int pid,
 		 * The click is over the CPU graphs. First try the exact
 		 * match.
 		 */
-		if (lamGetEntryByCPU(bin))
+		if (lamGetEntryByCPU(b))
 			return true;
 
 		/* Now look for a match, nearby the position of the click. */
 		for (int i = 1; i < variance; ++i) {
-			if (bin + i <= hSize && lamGetEntryByCPU(bin + i))
+			if (b + i <= hSize && lamGetEntryByCPU(b + i))
 				return true;
 
-			if (bin - i >= 0 && lamGetEntryByCPU(bin - i))
+			if (b - i >= 0 && lamGetEntryByCPU(b - i))
 				return true;
 		}
 
@@ -1007,15 +1007,15 @@  bool KsGLWidget::_find(int bin, int sd, int cpu, int pid,
 		 * The click is over the Task graphs. First try the exact
 		 * match.
 		 */
-		if (lamGetEntryByPid(bin))
+		if (lamGetEntryByPid(b))
 			return true;
 
 		/* Now look for a match, nearby the position of the click. */
 		for (int i = 1; i < variance; ++i) {
-			if ((bin + i <= hSize) && lamGetEntryByPid(bin + i))
+			if ((b + i <= hSize) && lamGetEntryByPid(b + i))
 				return true;
 
-			if ((bin - i >= 0) && lamGetEntryByPid(bin - i))
+			if ((b - i >= 0) && lamGetEntryByPid(b - i))
 				return true;
 		}