diff options
author | Christian Glöckner <cgloeckner@freenet.de> | 2016-05-27 09:18:41 +0200 |
---|---|---|
committer | Christian Glöckner <cgloeckner@freenet.de> | 2016-05-27 09:18:41 +0200 |
commit | 3846acf047ff9a37d0cb7bedf7fb7faa46473111 (patch) | |
tree | dbcc69a0bb3451c53468d40bcb2ea6456f727c0b | |
parent | 52b37cac974eb150d49eee1f0b5ba3654f6d7716 (diff) |
added another range-based loop
-rw-r--r-- | src/drumkitparser.cc | 7 | ||||
-rw-r--r-- | src/inputprocessor.cc | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/drumkitparser.cc b/src/drumkitparser.cc index cd1c32d..dd79bce 100644 --- a/src/drumkitparser.cc +++ b/src/drumkitparser.cc @@ -195,11 +195,7 @@ void DrumKitParser::endTag(const std::string& name) kit.instruments.push_back(std::move(ptr)); // Assign kit channel numbers to instruments channels. - std::vector<InstrumentChannel*>::iterator ic = parser.channellist.begin(); - while(ic != parser.channellist.end()) - { - InstrumentChannel* c = *ic; - + for (auto& c: parser.channellist) { std::string cname = c->name; if(channelmap.find(cname) != channelmap.end()) { @@ -226,7 +222,6 @@ void DrumKitParser::endTag(const std::string& name) c->name.c_str(), c->num, i.name().c_str()); */ } - ic++; } channelmap.clear(); diff --git a/src/inputprocessor.cc b/src/inputprocessor.cc index a5d8213..1676090 100644 --- a/src/inputprocessor.cc +++ b/src/inputprocessor.cc @@ -72,7 +72,7 @@ bool InputProcessor::processOnset(const event_t& event, size_t pos, double resam if(ev_instr < kit.instruments.size()) { - instr = kit.instruments[ev_instr]; + instr = kit.instruments[ev_instr].get(); } if(instr == nullptr || !instr->isValid()) |