refactor: use reference in for-range loops

Related-To: NEO-9038
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-10-03 15:02:52 +00:00
committed by Compute-Runtime-Automation
parent 9b344280d6
commit 895a586083
16 changed files with 34 additions and 34 deletions

View File

@@ -620,7 +620,7 @@ int IafNlApi::nlOperation(struct nl_cache_ops *ops, struct genl_cmd *cmd, struct
if (info->attrs[IAF_ATTR_CMD_OP_CONTEXT]) {
uint64_t context = pNlApi->nlaGetU64(info->attrs[IAF_ATTR_CMD_OP_CONTEXT]);
bool found = false;
for (auto i : validContexts) {
for (auto &i : validContexts) {
if (context == i) {
found = true;
break;
@@ -699,7 +699,7 @@ ze_result_t IafNlApi::initPorts(const uint32_t fabricId, std::vector<IafPort> &i
iafPorts.clear();
return ZE_RESULT_ERROR_UNKNOWN;
}
for (auto port : ports) {
for (auto &port : ports) {
IafPort p = {};
IafPortSpeed rxSpeed, txSpeed;
uint8_t neighbourPortNumber = 0;
@@ -725,7 +725,7 @@ ze_result_t IafNlApi::getPorts(const std::string &devicePciPath, std::vector<Iaf
std::string path;
path.clear();
std::vector<std::string> list = NEO::Directory::getFiles(devicePciPath);
for (auto entry : list) {
for (auto &entry : list) {
if ((entry.find(iafDirectory) != std::string::npos) ||
(entry.find(iafDirectoryLegacy) != std::string::npos)) {
path = entry + fabricIdFile;