Skip to content

Commit

Permalink
3
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed Sep 26, 2024
1 parent 1e4ca0c commit 1dfee88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions be/src/util/runtime_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ RuntimeProfile* RuntimeProfile::create_child(const std::string& name, bool inden
if (_children.empty()) {
add_child_unlock(child, indent, nullptr);
} else {
ChildVector::iterator pos = prepend ? _children.begin() : _children.end();
add_child_unlock(child, indent, (*pos).first);
auto* pos = prepend ? _children.begin()->first : nullptr;
add_child_unlock(child, indent, pos);
}
return child;
}
Expand All @@ -338,7 +338,7 @@ void RuntimeProfile::add_child_unlock(RuntimeProfile* child, bool indent, Runtim
DCHECK(child != nullptr);
_child_map[child->_name] = child;

if (loc == nullptr || loc == _children.end()->first) {
if (loc == nullptr) {
_children.push_back(std::make_pair(child, indent));
} else {
for (ChildVector::iterator it = _children.begin(); it != _children.end(); ++it) {
Expand Down

0 comments on commit 1dfee88

Please sign in to comment.