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;