Skip to content

Commit

Permalink
Merge pull request cms-sw#1015 from ktf/fix-leak-in-l1
Browse files Browse the repository at this point in the history
Remove leaking code with boost counterpart.
  • Loading branch information
ktf committed Oct 8, 2013
2 parents c29b271 + 0edf2b6 commit 4e93973
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 40 deletions.
4 changes: 2 additions & 2 deletions L1Trigger/GlobalMuonTrigger/src/L1MuGMTLUT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//---------------

#include <L1Trigger/GlobalMuonTrigger/src/L1MuGMTLUT.h>

#include <boost/algorithm/string.hpp>
#include <iostream>
#include <fstream>
#include <sstream>
Expand Down Expand Up @@ -328,7 +328,7 @@ void L1MuGMTLUT::MakeSubClass(const char* fname, const char* template_file_h,

// prepare parts
string ins_name (m_name);
string ins_name_upper = L1MuGMTLUTHelpers::upperCase (ins_name);
string ins_name_upper = boost::to_upper_copy(ins_name);
string ins_instance_string;
string ins_instances_enum;
for (unsigned i=0; i<m_InstNames.size(); i++) {
Expand Down
33 changes: 0 additions & 33 deletions L1Trigger/GlobalMuonTrigger/src/L1MuGMTLUTHelpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,36 +36,3 @@ int L1MuGMTLUTHelpers::replace(string & input, const string& gone, const string&
}
return n;
}

//--------------------------------------------------------------------------------
// Make an uppercase copy of s

string L1MuGMTLUTHelpers::upperCase(const string& s) {
char* buf = new char[s.length()];
s.copy(buf, s.length());
for(unsigned i = 0; i < s.length(); i++)
buf[i] = toupper(buf[i]);
string r(buf, s.length());
delete buf;
return r;
}



//--------------------------------------------------------------------------------
// Make an lowercase copy of s

string L1MuGMTLUTHelpers::lowerCase(const string& s) {
char* buf = new char[s.length()];
s.copy(buf, s.length());
for(unsigned i = 0; i < s.length(); i++)
buf[i] = tolower(buf[i]);
string r(buf, s.length());
delete buf;
return r;
}





5 changes: 0 additions & 5 deletions L1Trigger/GlobalMuonTrigger/src/L1MuGMTLUTHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ class L1MuGMTLUTHelpers {
};

static int replace(std::string& input, const std::string& gone, const std::string& it, bool multiple);

static std::string upperCase(const std::string& s);

static std::string lowerCase(const std::string& s);

};

#endif
Expand Down

0 comments on commit 4e93973

Please sign in to comment.