mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 00:17:03 +00:00
Use C++17 structured binding in more places.
Bug: dawn:824 Change-Id: Ie39d4f622bfb3dcc3a74b03d594efcea7139a9dc Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75069 Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Loko Kung <lokokung@google.com> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
1c49d1b43b
commit
5984d8d1a8
@@ -59,16 +59,16 @@ namespace dawn_wire { namespace client {
|
||||
// Move mRequests to a local variable so that further reentrant modifications of
|
||||
// mRequests don't invalidate the iterators.
|
||||
auto allRequests = std::move(mRequests);
|
||||
for (auto& it : allRequests) {
|
||||
closeFunc(&it.second);
|
||||
for (auto& [_, request] : allRequests) {
|
||||
closeFunc(&request);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
void ForAll(F&& f) {
|
||||
for (auto& it : mRequests) {
|
||||
f(&it.second);
|
||||
for (auto& [_, request] : mRequests) {
|
||||
f(&request);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -191,8 +191,8 @@ namespace dawn_wire { namespace server {
|
||||
}
|
||||
|
||||
bool TrackDeviceChild(DeviceInfo* info, ObjectType type, ObjectId id) {
|
||||
auto it = info->childObjectTypesAndIds.insert(PackObjectTypeAndId(type, id));
|
||||
if (!it.second) {
|
||||
auto [_, inserted] = info->childObjectTypesAndIds.insert(PackObjectTypeAndId(type, id));
|
||||
if (!inserted) {
|
||||
// An object of this type and id already exists.
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user