diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-05-26 13:12:38 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-05-31 08:49:43 -0600 |
| commit | 9557cc3e3feb80245e75b1b7966574e52d8dd115 (patch) | |
| tree | 3ece1c2144f703e34b7fc2737081fecabaf5825b /layers/core_validation.cpp | |
| parent | 57b4be486a1a214450ac3edb40d1b6968c1591a8 (diff) | |
| download | usermoji-9557cc3e3feb80245e75b1b7966574e52d8dd115.tar.xz | |
layers: Make layer_data const in getPoolNode()
Remove "[]" map operator and use iterator from find instead
to return pool ptr so that layer_data param can be const.
This will allow this function to be used from "PreValidate" calls
where no state is changed.
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 933c2f2d..ff93d9a6 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -3122,11 +3122,12 @@ static void deletePipelines(layer_data *my_data) { // Block of code at start here specifically for managing/tracking DSs // Return Pool node ptr for specified pool or else NULL -static DESCRIPTOR_POOL_NODE *getPoolNode(layer_data *my_data, const VkDescriptorPool pool) { - if (my_data->descriptorPoolMap.find(pool) == my_data->descriptorPoolMap.end()) { +static DESCRIPTOR_POOL_NODE *getPoolNode(const layer_data *dev_data, const VkDescriptorPool pool) { + auto pool_it = dev_data->descriptorPoolMap.find(pool); + if (pool_it == dev_data->descriptorPoolMap.end()) { return NULL; } - return my_data->descriptorPoolMap[pool]; + return pool_it->second; } // Return false if update struct is of valid type, otherwise flag error and return code from callback |
