Skip to content
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

Merged

Conversation

Dr15Jones
Copy link
Contributor

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.

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.
@cmsbuild
Copy link
Contributor

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.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@nclopezo, @ktf you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

DigiCollectionFP420::IndexRange returnIndexRange = map_[detID];
auto found = map_.find(detID);
if(found == map_.end()) {
return DigiCollectionFP420::Range{container_.begin(),container_.begin()};
Copy link
Contributor Author

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().]

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

@civanch
Copy link
Contributor

civanch commented Apr 23, 2014

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_1_X IBs unless changes (tests are also fine). @nclopezo, @ktf can you please take care of it?

ktf added a commit that referenced this pull request Apr 23, 2014
…CollectionFP420

Multithreading -- Removed mutable from DigiCollectionFP420
@ktf ktf merged commit c51036d into cms-sw:CMSSW_7_1_X Apr 23, 2014
@Dr15Jones Dr15Jones deleted the removeUnneededMutableFromDigiCollectionFP420 branch April 23, 2014 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants