Mercurial > hg > orthanc
changeset 6391:ce6f5d416db1
cppcheck: unreadVariable
| author | Alain Mazy <am@orthanc.team> |
|---|---|
| date | Wed, 12 Nov 2025 13:07:16 +0100 |
| parents | abdfbc4e05df |
| children | c6a9ec58d8d1 5eac63633d1d |
| files | OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp OrthancServer/Resources/RunCppCheck.sh |
| diffstat | 2 files changed, 1 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp Wed Nov 12 13:01:06 2025 +0100 +++ b/OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp Wed Nov 12 13:07:16 2025 +0100 @@ -918,12 +918,7 @@ { // Success, try and retrieve the status of the job JobsIndex::const_iterator it = jobsIndex_.find(id); - if (it == jobsIndex_.end()) - { - // Should not happen - state = JobState_Failure; - } - else + if (it != jobsIndex_.end()) { const JobStatus& status = it->second->GetLastStatus(); successContent = status.GetPublicContent();
--- a/OrthancServer/Resources/RunCppCheck.sh Wed Nov 12 13:01:06 2025 +0100 +++ b/OrthancServer/Resources/RunCppCheck.sh Wed Nov 12 13:07:16 2025 +0100 @@ -26,8 +26,6 @@ syntaxError:../../OrthancFramework/UnitTestsSources/ZipTests.cpp:133 syntaxError:../../OrthancServer/UnitTestsSources/UnitTestsMain.cpp:325 uninitMemberVar:../../OrthancServer/Sources/ServerJobs/StorageCommitmentScpJob.cpp:419 -unreadVariable:../../OrthancFramework/Sources/FileStorage/StorageAccessor.cpp -unreadVariable:../../OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp:1173 unusedFunction useInitializationList:../../OrthancFramework/Sources/Images/PngReader.cpp:91 useInitializationList:../../OrthancFramework/Sources/Images/PngWriter.cpp:99 @@ -67,7 +65,6 @@ throwInNoexceptFunction:../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.h:218 throwInNoexceptFunction:../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.h:376 throwInNoexceptFunction:../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.h:496 - EOF # TODO: re-enable nullPointerOutOfMemory
