| 506 | } |
| 507 | |
| 508 | void CheckUnusedFunctions::updateFunctionData(const CheckUnusedFunctions& checkUnusedFunctions) |
| 509 | { |
| 510 | for (const auto& entry : checkUnusedFunctions.mFunctions) |
| 511 | { |
| 512 | FunctionUsage &usage = mFunctions[entry.first]; |
| 513 | if (!usage.lineNumber) { |
| 514 | usage.lineNumber = entry.second.lineNumber; |
| 515 | usage.column = entry.second.column; |
| 516 | } |
| 517 | // TODO: why always overwrite this but not the filename and line? |
| 518 | usage.fileIndex = entry.second.fileIndex; |
| 519 | if (usage.filename.empty()) |
| 520 | usage.filename = entry.second.filename; |
| 521 | usage.usedOtherFile |= entry.second.usedOtherFile; |
| 522 | usage.usedSameFile |= entry.second.usedSameFile; |
| 523 | } |
| 524 | mFunctionDecl.insert(mFunctionDecl.cend(), checkUnusedFunctions.mFunctionDecl.cbegin(), checkUnusedFunctions.mFunctionDecl.cend()); |
| 525 | mFunctionCalls.insert(checkUnusedFunctions.mFunctionCalls.cbegin(), checkUnusedFunctions.mFunctionCalls.cend()); |
| 526 | } |