NOLINTNEXTLINE(performance-unnecessary-value-param) - technically correct but we are moving the given values
| 227 | |
| 228 | // NOLINTNEXTLINE(performance-unnecessary-value-param) - technically correct but we are moving the given values |
| 229 | void ProgramMemory::replace(ProgramMemory pm, bool skipUnknown) |
| 230 | { |
| 231 | if (pm.empty()) |
| 232 | return; |
| 233 | |
| 234 | copyOnWrite(); |
| 235 | |
| 236 | for (auto&& p : (*pm.mValues)) { |
| 237 | if (skipUnknown) { |
| 238 | auto it = mValues->find(p.first); |
| 239 | if (it != mValues->end() && it->second.isUninitValue()) |
| 240 | continue; |
| 241 | } |
| 242 | (*mValues)[p.first] = std::move(p.second); |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | void ProgramMemory::copyOnWrite() |
| 247 | { |
no test coverage detected