Skip to content

Commit

Permalink
Make "names" const so that it's thread safe
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Grimes committed May 22, 2015
1 parent 2deef69 commit 927422c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions RecoJets/JetProducers/plugins/VirtualJetProducer.cc
Expand Up @@ -61,7 +61,7 @@ namespace reco {
}

//______________________________________________________________________________
const char *VirtualJetProducer::JetType::names[] = {
const char *const VirtualJetProducer::JetType::names[] = {
"BasicJet","GenJet","CaloJet","PFJet","TrackJet","PFClusterJet"
};

Expand All @@ -70,7 +70,7 @@ const char *VirtualJetProducer::JetType::names[] = {
VirtualJetProducer::JetType::Type
VirtualJetProducer::JetType::byName(const string &name)
{
const char **pos = std::find(names, names + LastJetType, name);
const char *const *pos = std::find(names, names + LastJetType, name);
if (pos == names + LastJetType) {
std::string errorMessage="Requested jetType not supported: "+name+"\n";
throw cms::Exception("Configuration",errorMessage);
Expand Down
2 changes: 1 addition & 1 deletion RecoJets/JetProducers/plugins/VirtualJetProducer.h
Expand Up @@ -44,7 +44,7 @@ class dso_hidden VirtualJetProducer : public edm::stream::EDProducer<>
PFClusterJet,
LastJetType // no real type, technical
};
static const char *names[];
static const char *const names[];
static Type byName(const std::string &name);
};

Expand Down

0 comments on commit 927422c

Please sign in to comment.