Change priority value from number to predefined value
authorSukhyungKang <shine.kang@samsung.com>
Wed, 14 May 2025 04:20:34 +0000 (13:20 +0900)
committerSukhyungKang <shine.kang@samsung.com>
Wed, 14 May 2025 04:20:34 +0000 (13:20 +0900)
Signed-off-by: SukhyungKang <shine.kang@samsung.com>
src/service_info.cc

index d9835817d1e7e28687425527e65c99640e275151..b2cf9e93f5e442a7de7575ce0e12345ded69a63e 100644 (file)
@@ -31,6 +31,9 @@ static const std::string kType = kTagUnitedService + ":type";
 static const std::string kPath = kTagUnitedService + ":path";
 static const std::string kPriority = kTagUnitedService + ":priority";
 
+static const int kMinPriority = 1;
+static const int kMaxPriority = 99;
+
 }  // namespace
 
 namespace tizen_base {
@@ -60,7 +63,7 @@ ServiceInfo::ServiceInfo(std::string conf_name,
     priority_ = stoul(priority_str);
     _D("Priority=%d", priority_);
 
-    if (priority_ < 1 || priority_ > 99) {
+    if (priority_ < kMinPriority || priority_ > kMaxPriority) {
       _E("Invalid priority");
       priority_ = 0;
     }