From c886bd5b5be7a3c15e9fccb7e403a35dbf8351a2 Mon Sep 17 00:00:00 2001 From: Anton Smirnov Date: Wed, 25 Mar 2026 12:19:52 +0200 Subject: [PATCH] FIX copy/paste error in remove Module/Patch logic could not resist proposing this obvious fix :) the style is kept unchnaged --- olcSoundWaveEngine.h | 4 ++-- source/olcSoundWaveEngine.h | 4 ++-- source/swe_synth_modular.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/olcSoundWaveEngine.h b/olcSoundWaveEngine.h index e482440..a71c49e 100644 --- a/olcSoundWaveEngine.h +++ b/olcSoundWaveEngine.h @@ -1269,7 +1269,7 @@ namespace olc::sound bool ModularSynth::RemoveModule(Module* pModule) { - if (std::find(m_vModules.begin(), m_vModules.end(), pModule) == std::end(m_vModules)) + if (std::find(m_vModules.begin(), m_vModules.end(), pModule) != std::end(m_vModules)) { m_vModules.erase(std::remove(m_vModules.begin(), m_vModules.end(), pModule), m_vModules.end()); return true; @@ -1300,7 +1300,7 @@ namespace olc::sound { std::pair newPatch = std::pair(pInput, pOutput); - if (std::find(m_vPatches.begin(), m_vPatches.end(), newPatch) == std::end(m_vPatches)) + if (std::find(m_vPatches.begin(), m_vPatches.end(), newPatch) != std::end(m_vPatches)) { m_vPatches.erase(std::remove(m_vPatches.begin(), m_vPatches.end(), newPatch), m_vPatches.end()); return true; diff --git a/source/olcSoundWaveEngine.h b/source/olcSoundWaveEngine.h index e482440..a71c49e 100644 --- a/source/olcSoundWaveEngine.h +++ b/source/olcSoundWaveEngine.h @@ -1269,7 +1269,7 @@ namespace olc::sound bool ModularSynth::RemoveModule(Module* pModule) { - if (std::find(m_vModules.begin(), m_vModules.end(), pModule) == std::end(m_vModules)) + if (std::find(m_vModules.begin(), m_vModules.end(), pModule) != std::end(m_vModules)) { m_vModules.erase(std::remove(m_vModules.begin(), m_vModules.end(), pModule), m_vModules.end()); return true; @@ -1300,7 +1300,7 @@ namespace olc::sound { std::pair newPatch = std::pair(pInput, pOutput); - if (std::find(m_vPatches.begin(), m_vPatches.end(), newPatch) == std::end(m_vPatches)) + if (std::find(m_vPatches.begin(), m_vPatches.end(), newPatch) != std::end(m_vPatches)) { m_vPatches.erase(std::remove(m_vPatches.begin(), m_vPatches.end(), newPatch), m_vPatches.end()); return true; diff --git a/source/swe_synth_modular.cpp b/source/swe_synth_modular.cpp index 3481039..6fb286a 100644 --- a/source/swe_synth_modular.cpp +++ b/source/swe_synth_modular.cpp @@ -38,7 +38,7 @@ namespace olc::sound::synth bool ModularSynth::RemoveModule(Module* pModule) { - if (std::find(m_vModules.begin(), m_vModules.end(), pModule) == std::end(m_vModules)) + if (std::find(m_vModules.begin(), m_vModules.end(), pModule) != std::end(m_vModules)) { m_vModules.erase(std::remove(m_vModules.begin(), m_vModules.end(), pModule), m_vModules.end()); return true; @@ -69,7 +69,7 @@ namespace olc::sound::synth { std::pair newPatch = std::pair(pInput, pOutput); - if (std::find(m_vPatches.begin(), m_vPatches.end(), newPatch) == std::end(m_vPatches)) + if (std::find(m_vPatches.begin(), m_vPatches.end(), newPatch) != std::end(m_vPatches)) { m_vPatches.erase(std::remove(m_vPatches.begin(), m_vPatches.end(), newPatch), m_vPatches.end()); return true;