29 lines
758 B
Diff
29 lines
758 B
Diff
From 2ddd09ee581829e482d55db70b0cc92724b23c8d Mon Sep 17 00:00:00 2001
|
|
From: chenjingwen <lhchenjw@gmail.com>
|
|
Date: Mon, 20 Nov 2023 10:48:18 +0800
|
|
Subject: [PATCH 2/2] service: fix power_of_2 bug
|
|
|
|
fix a bug
|
|
|
|
Signed-off-by: chenjingwen <lhchenjw@gmail.com>
|
|
---
|
|
observer_agent/service/main.cpp | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/observer_agent/service/main.cpp b/observer_agent/service/main.cpp
|
|
index 940cf83..f177645 100644
|
|
--- a/observer_agent/service/main.cpp
|
|
+++ b/observer_agent/service/main.cpp
|
|
@@ -51,7 +51,7 @@ static bool power_of_2(unsigned int num)
|
|
{
|
|
if (num == 0)
|
|
return false;
|
|
- if (num & (num - 1) != 0)
|
|
+ if ((num & (num - 1)) != 0)
|
|
return false;
|
|
return true;
|
|
}
|
|
--
|
|
2.33.0
|
|
|