New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed mutable from DigiCollectionFP420 #3440
Removed mutable from DigiCollectionFP420 #3440
Conversation
Removed mutables from DigiCollectionFP420 by using std::map::find instead of std::map::operator[]. The code in question was not dependent upon the default value being placed in the map, it only wanted to see if a value was available. This avoids warning messages from the static analyzer.
A new Pull Request was created by @Dr15Jones (Chris Jones) for CMSSW_7_1_X. Removed mutable from DigiCollectionFP420 It involves the following packages: DataFormats/FP420Digi @cmsbuild, @civanch, @Degano, @mdhildreth, @nclopezo can you please review it and eventually sign? Thanks. |
DigiCollectionFP420::IndexRange returnIndexRange = map_[detID]; | ||
auto found = map_.find(detID); | ||
if(found == map_.end()) { | ||
return DigiCollectionFP420::Range{container_.begin(),container_.begin()}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To the best of my ability, I believe this to be the same return value as the original code. The original code would have gotten a defaultly constructed IndexRange
(which is std::pair<unsigned int, unsigned int>
). That default would have been (0,0). The code then takes those values and adds them to container_.begin()
to get the return values. [NOTE: in the original code the .second
value is compared against 0 and if it is equal the 0 is added to container_.begin()
.]
+1 |
…CollectionFP420 Multithreading -- Removed mutable from DigiCollectionFP420
Removed mutables from DigiCollectionFP420 by using std::map::find
instead of std::map::operator[]. The code in question was not dependent
upon the default value being placed in the map, it only wanted to
see if a value was available. This avoids warning messages from the
static analyzer.