Skip to content

Commit 224f755

Browse files
committed
CBD-6348: [BP] clang-analyze: initialization value is never read
Value stored to 'priString' during its initialization is never read Use the utility function format_as instead Change-Id: Id3971be90a70b3351ebaea51e535403c6603bc70 Reviewed-on: https://review.couchbase.org/c/kv_engine/+/234821 Tested-by: Trond Norbye <[email protected]> Reviewed-by: Pavlos Georgiou <[email protected]> Well-Formed: Restriction Checker
1 parent c472cf4 commit 224f755

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

engines/ep/src/connhandler.cc

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -354,19 +354,7 @@ void ConnHandler::addStats(const AddStatFn& add_stat, CookieIface& c) {
354354
}
355355
}
356356
const auto priority = cookie.load()->getConnectionIface().getPriority();
357-
const char* priString = "<INVALID>";
358-
switch (priority) {
359-
case ConnectionPriority::High:
360-
priString = "high";
361-
break;
362-
case ConnectionPriority::Medium:
363-
priString = "medium";
364-
break;
365-
case ConnectionPriority::Low:
366-
priString = "low";
367-
break;
368-
}
369-
addStat("priority", priString, add_stat, c);
357+
addStat("priority", format_as(priority), add_stat, c);
370358
addStat(DcpControlKeys::FlatBuffersSystemEvents,
371359
areFlatBuffersSystemEventsEnabled(),
372360
add_stat,

0 commit comments

Comments
 (0)