From 2314cbf23c8857ef37a16fdee5b7f8636867b1ef Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 13 Jan 2013 00:41:59 +0000 Subject: Remove unnecessary linear searches. git-svn-id: http://svn.drobilla.net/lad/trunk/machina@4942 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/JackDriver.cpp | 3 +-- 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, 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 . */ -#include - #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()); 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 -- cgit v1.2.1