chaoyli commented on a change in pull request #3339: URL: https://github.com/apache/incubator-doris/pull/3339#discussion_r412622055
########## File path: be/src/olap/rowset_graph.cpp ########## @@ -237,25 +232,26 @@ OLAPStatus RowsetGraph::capture_consistent_versions(const Version& spec_version, reversed_path.push_back(tmp_vertex_index); } - // Make version_path from reversed_path. - std::stringstream shortest_path_for_debug; - for (size_t path_id = reversed_path.size() - 1; path_id > 0; --path_id) { - int64_t tmp_start_vertex_value = _version_graph[reversed_path[path_id]].value; - int64_t tmp_end_vertex_value = _version_graph[reversed_path[path_id - 1]].value; - - // tmp_start_vertex_value mustn't be equal to tmp_end_vertex_value - if (tmp_start_vertex_value <= tmp_end_vertex_value) { - version_path->emplace_back(tmp_start_vertex_value, tmp_end_vertex_value - 1); - } else { - version_path->emplace_back(tmp_end_vertex_value, tmp_start_vertex_value - 1); - } + if (version_path != nullptr) { Review comment: I think there is no necessity for capture_consistent_versions() judge version_path is nullptr or not. So you can DCHECK(version_path != nullptr) instead. Of course, you should guarantee that the caller should the version_path is not nullptr. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org