Code refactor

This commit:
- Optimizes usage of std::unordered map
- Corrects variables naming and output messages
- Minor changes in using std::string methods
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
This commit is contained in:
Kacper Nowak
2022-03-22 14:54:28 +00:00
committed by Compute-Runtime-Automation
parent f6c5995219
commit 1b6a907b13
5 changed files with 24 additions and 19 deletions

View File

@ -670,8 +670,7 @@ inline bool YamlParser::readValueChecked<std::string>(const Node &node, std::str
if (Token::Type::LiteralString != token.traits.type) {
return false;
}
outValue.resize(token.len);
std::copy(token.pos, token.pos + token.len, outValue.begin());
outValue.assign(token.pos, token.len);
return true;
}
} // namespace Yaml

View File

@ -1395,6 +1395,7 @@ DecodeError decodeSingleDeviceBinary<NEO::DeviceBinaryFormat::Zebin>(ProgramInfo
if (DecodeError::Success != zeInfoErr) {
return zeInfoErr;
}
dst.globalsDeviceToHostNameMap.reserve(globalHostAccessMapping.size());
for (auto it = globalHostAccessMapping.begin(); it != globalHostAccessMapping.end(); it++) {
dst.globalsDeviceToHostNameMap[it->deviceName] = it->hostName;
}