From 3846acf047ff9a37d0cb7bedf7fb7faa46473111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gl=C3=B6ckner?= Date: Fri, 27 May 2016 09:18:41 +0200 Subject: added another range-based loop --- src/drumkitparser.cc | 7 +------ src/inputprocessor.cc | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src') 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::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()) -- cgit v1.2.3