github-actions[bot] commented on code in PR #34397:
URL: https://github.com/apache/doris/pull/34397#discussion_r1590238148
##########
be/src/common/status.h:
##########
@@ -301,15 +305,39 @@ extern ErrorCodeState
error_states[MAX_ERROR_CODE_DEFINE_NUM];
class ErrorCodeInitializer {
public:
- ErrorCodeInitializer() {
-#define M(NAME, ENABLESTACKTRACE) error_states[TStatusCode::NAME].stacktrace =
ENABLESTACKTRACE;
+ ErrorCodeInitializer(int temp) : signal_value(temp) {
Review Comment:
warning: function 'ErrorCodeInitializer' exceeds recommended size/complexity
thresholds [readability-function-size]
```cpp
ErrorCodeInitializer(int temp) : signal_value(temp) {
^
```
<details>
<summary>Additional context</summary>
**be/src/common/status.h:307:** 894 statements (threshold 800)
```cpp
ErrorCodeInitializer(int temp) : signal_value(temp) {
^
```
</details>
##########
be/src/common/status.h:
##########
@@ -301,15 +305,39 @@
class ErrorCodeInitializer {
public:
- ErrorCodeInitializer() {
-#define M(NAME, ENABLESTACKTRACE) error_states[TStatusCode::NAME].stacktrace =
ENABLESTACKTRACE;
+ ErrorCodeInitializer(int temp) : signal_value(temp) {
+ for (int i = 0; i < MAX_ERROR_CODE_DEFINE_NUM; ++i) {
+ error_states[i].error_code = 0;
Review Comment:
warning: use range-based for loop instead [modernize-loop-convert]
```suggestion
for (auto & error_state : error_states) {
error_state.error_code = 0;
```
--
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]