!598 告警清理

Merge pull request !598 from wenlong_12/master
This commit is contained in:
openharmony_ci 2024-09-19 10:04:40 +00:00 committed by Gitee
commit a53787a1c3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -892,7 +892,10 @@ Val& HashList<Key, Val>::operator[](const Key &key)
} else {
pnode = valueTab_[key];
}
if (pnode) {
if (pnode == nullptr) {
static Val val = Val();
return val;
} else {
MoveToHead(pnode);
}
return pnode->val_;
@ -979,8 +982,10 @@ void HashList<Key, Val>::pop_back()
return;
}
LinkNode<Key, Val>* pnode = LinkNode<Key, Val>::GetLinkNode(dataHead_.prev_);
valueTab_.erase(pnode->key_);
ReclaimNode(pnode);
if (pnode != nullptr) {
valueTab_.erase(pnode->key_);
ReclaimNode(pnode);
}
}
template<typename Key, typename Val>
@ -1091,10 +1096,12 @@ auto HashList<Key, Val>::AllocateNode(const Key &key)
}
LinkNode<Key, Val> *pnode = LinkNode<Key, Val>::GetLinkNode(freeHead_.next_);
freeHead_.next_ = freeHead_.next_->next_;
pnode->link_.next_ = nullptr;
pnode->link_.prev_ = nullptr;
pnode->key_ = key;
pnode->val_ = Val();
if (pnode != nullptr) {
pnode->link_.next_ = nullptr;
pnode->link_.prev_ = nullptr;
pnode->key_ = key;
pnode->val_ = Val();
}
return pnode;
}