diff options
author | David Robillard <d@drobilla.net> | 2013-01-13 00:41:59 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-01-13 00:41:59 +0000 |
commit | 2314cbf23c8857ef37a16fdee5b7f8636867b1ef (patch) | |
tree | c1944f554b063e14084fb6bc2286c880126179d1 /src | |
parent | e2fbbb8229aaf66578b2a1b18eab590a2542b211 (diff) | |
download | machina-2314cbf23c8857ef37a16fdee5b7f8636867b1ef.tar.gz machina-2314cbf23c8857ef37a16fdee5b7f8636867b1ef.tar.bz2 machina-2314cbf23c8857ef37a16fdee5b7f8636867b1ef.zip |
Remove unnecessary linear searches.
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@4942 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/JackDriver.cpp | 3 | ||||
-rw-r--r-- | src/engine/MachineBuilder.cpp | 15 |
2 files changed, 3 insertions, 15 deletions
diff --git a/src/engine/JackDriver.cpp b/src/engine/JackDriver.cpp index d8442b1..072029d 100644 --- a/src/engine/JackDriver.cpp +++ b/src/engine/JackDriver.cpp @@ -191,8 +191,7 @@ JackDriver::read_input_recording(SPtr<Machine> machine, const TimeStamp rel_time_frames = TimeStamp(_frames_unit, ev.time); const TimeStamp time_frames = _record_dur + rel_time_frames; - _recorder->write(time.ticks_to_beats( - time_frames), ev.size, ev.buffer); + _recorder->write(time.ticks_to_beats(time_frames), ev.size, ev.buffer); } if (n_events > 0) { diff --git a/src/engine/MachineBuilder.cpp b/src/engine/MachineBuilder.cpp index 57d6c2f..27fb68c 100644 --- a/src/engine/MachineBuilder.cpp +++ b/src/engine/MachineBuilder.cpp @@ -15,8 +15,6 @@ * along with Machina. If not, see <http://www.gnu.org/licenses/>. */ -#include <algorithm> - #include "lv2/lv2plug.in/ns/ext/midi/midi.h" #include "machina/Machine.hpp" @@ -204,12 +202,7 @@ MachineBuilder::resolve_note(Raul::TimeStamp t, resolved->set_exit_action(SPtr<Action>()); set_node_duration(_connect_node, resolved->duration()); resolved = _connect_node; - if (std::find(_machine->nodes().begin(), - _machine->nodes().end(), - _connect_node) - == _machine->nodes().end()) { - _machine->add_node(_connect_node); - } + _machine->add_node(_connect_node); } else { _connect_node = resolved; @@ -301,13 +294,9 @@ MachineBuilder::resolve() } // Add initial note if necessary - if ((_machine->nodes().size() > 0) - && (std::find(_machine->nodes().begin(), _machine->nodes().end(), - _initial_node) - == _machine->nodes().end())) { + if (_machine->nodes().size() > 0) { _machine->add_node(_initial_node); } - } SPtr<Machine> |