mirror of
https://github.com/openharmony/device_profile_core.git
synced 2026-07-19 17:05:37 -04:00
!46 fix logic problem when merge subscribe info
Merge pull request !46 from Gymee/code_review
This commit is contained in:
@@ -241,14 +241,12 @@ void DistributedDeviceProfileClient::MergeSubscribeInfoLocked(std::list<Subscrib
|
||||
[&newSubscribeInfo](const auto& subscribeInfo) {
|
||||
return subscribeInfo.profileEvent == newSubscribeInfo.profileEvent;
|
||||
});
|
||||
if (iter != subscribeInfos.end()) {
|
||||
if (iter == subscribeInfos.end()) {
|
||||
subscribeInfos.emplace_back(newSubscribeInfo);
|
||||
continue;
|
||||
}
|
||||
// override with the new suscribe info for same profile event
|
||||
if (*iter != newSubscribeInfo) {
|
||||
*iter = newSubscribeInfo;
|
||||
}
|
||||
*iter = newSubscribeInfo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user