Skip to content

Commit

Permalink
Merge pull request #32779 from guitargeek/CSCDBL1TPParametersExtended…
Browse files Browse the repository at this point in the history
…_algorithm

Include <algorithm> in CSCDBL1TPParametersExtended.cc for std::find
  • Loading branch information
cmsbuild committed Feb 9, 2021
2 parents 1cc9b1e + d304a00 commit 0553ee4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CondFormats/CSCObjects/src/CSCDBL1TPParametersExtended.cc
@@ -1,5 +1,7 @@
#include "CondFormats/CSCObjects/interface/CSCDBL1TPParametersExtended.h"

#include <algorithm>

CSCDBL1TPParametersExtended::CSCDBL1TPParametersExtended() {
paramsInt_.resize(paramNamesInt_.size());
paramsBool_.resize(paramNamesBool_.size());
Expand All @@ -8,21 +10,21 @@ CSCDBL1TPParametersExtended::CSCDBL1TPParametersExtended() {
CSCDBL1TPParametersExtended::~CSCDBL1TPParametersExtended() {}

int CSCDBL1TPParametersExtended::getValueInt(const std::string& s) const {
const int index = find(paramNamesInt_.begin(), paramNamesInt_.end(), s) - paramNamesInt_.begin();
const int index = std::find(paramNamesInt_.begin(), paramNamesInt_.end(), s) - paramNamesInt_.begin();
return paramsInt_[index];
}

bool CSCDBL1TPParametersExtended::getValueBool(const std::string& s) const {
const int index = find(paramNamesBool_.begin(), paramNamesBool_.end(), s) - paramNamesBool_.begin();
const int index = std::find(paramNamesBool_.begin(), paramNamesBool_.end(), s) - paramNamesBool_.begin();
return paramsBool_[index];
}

void CSCDBL1TPParametersExtended::setValue(const std::string& s, int v) {
const int index = find(paramNamesInt_.begin(), paramNamesInt_.end(), s) - paramNamesInt_.begin();
const int index = std::find(paramNamesInt_.begin(), paramNamesInt_.end(), s) - paramNamesInt_.begin();
paramsInt_[index] = v;
}

void CSCDBL1TPParametersExtended::setValue(const std::string& s, bool v) {
const int index = find(paramNamesBool_.begin(), paramNamesBool_.end(), s) - paramNamesBool_.begin();
const int index = std::find(paramNamesBool_.begin(), paramNamesBool_.end(), s) - paramNamesBool_.begin();
paramsBool_[index] = v;
}

0 comments on commit 0553ee4

Please sign in to comment.