github-actions[bot] commented on code in PR #24881:
URL: https://github.com/apache/doris/pull/24881#discussion_r1335818101
##########
be/src/util/runtime_profile.h:
##########
@@ -348,7 +361,12 @@ class RuntimeProfile {
void set_name(const std::string& name) { _name = name; }
int64_t metadata() const { return _metadata; }
- void set_metadata(int64_t md) { _metadata = md; }
+ void set_metadata(int64_t md) {
+ _is_set_metadata = true;
+ _metadata = md;
+ }
+
+ bool is_set_metadata() const { return _is_set_metadata; }
Review Comment:
warning: function 'is_set_metadata' should be marked [[nodiscard]]
[modernize-use-nodiscard]
```suggestion
[[nodiscard]] bool is_set_metadata() const { return _is_set_metadata; }
```
##########
be/src/util/runtime_profile.cpp:
##########
@@ -416,7 +420,7 @@ RuntimeProfile::Counter* RuntimeProfile::add_counter(const
std::string& name, TU
DCHECK(parent_counter_name == ROOT_COUNTER ||
_counter_map.find(parent_counter_name) != _counter_map.end());
- Counter* counter = _pool->add(new Counter(type, 0));
+ Counter* counter = _pool->add(new Counter(type, 0, level));
Review Comment:
warning: variable 'counter' is not initialized
[cppcoreguidelines-init-variables]
```suggestion
Counter* counter = nullptr = _pool->add(new Counter(type, 0, level));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]