You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2022/05/29 08:52:41 UTC

[GitHub] [incubator-pegasus] acelyc111 commented on a diff in pull request #984: fix(collector): fix unexpected crash

acelyc111 commented on code in PR #984:
URL: https://github.com/apache/incubator-pegasus/pull/984#discussion_r884235678


##########
src/server/hotspot_partition_calculator.cpp:
##########
@@ -96,6 +96,11 @@ void hotspot_partition_calculator::init_perf_counter(int partition_count)
 void hotspot_partition_calculator::stat_histories_analyse(uint32_t data_type,
                                                           std::vector<int> &hot_points)
 {
+    int hot_point_size = _hot_points.size();
+    hot_points.resize(hot_point_size);
+    for (int i = 0; i < hot_point_size; i++) {
+        hot_points[i] = 0;
+    }

Review Comment:
   How about simplify code by using:
   ```
   hot_points.assign(_hot_points.size(), 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: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org