mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 17:26:06 +00:00
[llvm-exegesis] Use const reference for range variable
In the SubprocessMemory destructor, I was using a normal std::string to hold the name of the current shared memory name, but a const reference works just as well in this situation while having better performance characteristics. Fixes #90289
This commit is contained in:
parent
5569c219d3
commit
ad2816e734
@ -143,7 +143,7 @@ Expected<int> SubprocessMemory::setupAuxiliaryMemoryInSubprocess(
|
||||
}
|
||||
|
||||
SubprocessMemory::~SubprocessMemory() {
|
||||
for (std::string SharedMemoryName : SharedMemoryNames) {
|
||||
for (const std::string &SharedMemoryName : SharedMemoryNames) {
|
||||
if (shm_unlink(SharedMemoryName.c_str()) != 0) {
|
||||
errs() << "Failed to unlink shared memory section: " << strerror(errno)
|
||||
<< "\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user