Skip to content

Commit 3192ee6

Browse files
committed
[clang-tidy] Initialize all Cookie members
Some of the members in Cookie were not initialized as part of the constructor (but still initialized before they where used). Add initialization of the members as part of the constructor to get rid of the warning. Change-Id: I3709fb2af0df43be55b2ef27c9e0c7d6e55fedd4 Reviewed-on: https://review.couchbase.org/c/kv_engine/+/201750 Tested-by: Build Bot <[email protected]> Reviewed-by: Pavlos Georgiou <[email protected]>
1 parent d82d9ea commit 3192ee6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

daemon/cookie.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,9 @@ void Cookie::maybeLogSlowCommand(
440440
}
441441
}
442442

443-
Cookie::Cookie(Connection& conn) : connection(conn) {
443+
Cookie::Cookie(Connection& conn)
444+
: connection(conn),
445+
resource_allocation_domain(ResourceAllocationDomain::None) {
444446
}
445447

446448
void Cookie::initialize(const cb::mcbp::Header& header, bool tracing_enabled) {

daemon/cookie.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,19 +683,19 @@ class Cookie : public CookieIface {
683683

684684
/// The high resolution timer value for when we started throttling
685685
std::chrono::steady_clock::time_point throttle_start;
686-
std::chrono::duration<int32_t, std::micro> total_throttle_time;
686+
std::chrono::duration<int32_t, std::micro> total_throttle_time{};
687687

688688
/// The location where we checked for available resources so that we
689689
/// update the correct throttling gauge
690690
ResourceAllocationDomain resource_allocation_domain;
691691

692692
/// The per command read throttling factor (we might want to differentiate
693693
/// commands which have to do disk IO vs in-memory commands)
694-
float read_thottling_factor;
694+
float read_thottling_factor{};
695695

696696
/// The per command write throttling factor (we might want to differentiate
697697
/// commands which have to do disk IO vs in-memory commands)
698-
float write_thottling_factor;
698+
float write_thottling_factor{};
699699

700700
/**
701701
* The status for the async io operation

0 commit comments

Comments
 (0)