const s_smpi_key_elem_t* elem = T::keyvals_.at(keyval);
if(elem==nullptr)
return MPI_ERR_ARG;
- if(attributes()->empty()){
- *flag=0;
- return MPI_SUCCESS;
- }
+
const auto& attribs = attributes();
auto attr = attribs->find(keyval);
if (attr != attribs->end()) {
}
template <typename T> void Keyval::cleanup_attr(){
- if (not attributes()->empty()) {
- int flag=0;
- for (auto const& it : attributes_) {
- auto elm = T::keyvals_.find(it.first);
- if (elm != T::keyvals_.end()) {
- smpi_key_elem elem = elm->second;
- if(elem != nullptr){
- call_deleter<T>((T*)this, elem, it.first,it.second,&flag);
- }
- } else {
- // already deleted, not a problem
- flag=0;
+ int flag = 0;
+ for (auto const& it : attributes_) {
+ auto elm = T::keyvals_.find(it.first);
+ if (elm != T::keyvals_.end()) {
+ smpi_key_elem elem = elm->second;
+ if (elem != nullptr) {
+ call_deleter<T>((T*)this, elem, it.first, it.second, &flag);
}
+ } else {
+ // already deleted, not a problem
+ flag = 0;
}
}
}