Skip to content

Commit

Permalink
Thread safety cleanup in RecoBTau
Browse files Browse the repository at this point in the history
Make the return value of a const function be
a const pointer instead of just a pointer.
Eliminates a potential thread safety problem
reported by the clang static code analyzer.
  • Loading branch information
wddgit committed Apr 10, 2014
1 parent 4d77318 commit c4dfd20
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class GenericMVAComputerCache {
bool
update(const PhysicsTools::Calibration::MVAComputerContainer *calib);

inline GenericMVAComputer *getComputer(int index) const
inline GenericMVAComputer const* getComputer(int index) const
{ return index >= 0 ? computers[index].computer.get() : 0; }

inline bool isEmpty() const { return empty; }
Expand Down
2 changes: 1 addition & 1 deletion RecoBTau/JetTagComputer/src/GenericMVAJetTagComputer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ float GenericMVAJetTagComputer::discriminator(const TagInfoHelper &info) const
return -10.0;
}

GenericMVAComputer *computer = computerCache.getComputer(index);
GenericMVAComputer const* computer = computerCache.getComputer(index);

if (!computer)
return -10.0;
Expand Down

0 comments on commit c4dfd20

Please sign in to comment.