layers: Get rid of a bunch of linked list copying when retiring CBs
There was no reason to copy this.
Signed-off-by: Chris Forbes <chrisforbes@google.com>
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index dee2e7a..244ef69 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -579,9 +579,8 @@
if (pCBNode) {
if (pCBNode->pMemObjList.size() > 0) {
- list<VkDeviceMemory> mem_obj_list = pCBNode->pMemObjList;
- for (list<VkDeviceMemory>::iterator it = mem_obj_list.begin(); it != mem_obj_list.end(); ++it) {
- DEVICE_MEM_INFO *pInfo = get_mem_obj_info(dev_data, *it);
+ for (auto mem : pCBNode->pMemObjList) {
+ DEVICE_MEM_INFO *pInfo = get_mem_obj_info(dev_data, mem);
if (pInfo) {
pInfo->commandBufferBindings.erase(cb);
}