obs-vst: Improve some string handling

- Use constant references where appropriate
- Avoid unnecessary use of strcmp / strlen
- Clear std::string with clear()

Issues detected by PVS Studio.
This commit is contained in:
Richard Stanway 2022-07-27 22:37:50 +02:00 • committed by Matt Gajownik
commit 02c6ce8b58
3 changed files with 9 additions and 9 deletions

View file

@ -135,7 +135,7 @@ void VSTPlugin::cleanupChannelBuffers()
numChannels = 0;
}
void VSTPlugin::loadEffectFromPath(std::string path)
void VSTPlugin::loadEffectFromPath(const std::string &path)
{
if (this->pluginPath.compare(path) != 0) {
unloadEffect();
@ -309,7 +309,7 @@ void VSTPlugin::unloadEffect()
unloadLibrary();
pluginPath = "";
pluginPath.clear();
}
bool VSTPlugin::isEditorOpen()
@ -403,7 +403,7 @@ std::string VSTPlugin::getChunk()
}
}
void VSTPlugin::setChunk(std::string data)
void VSTPlugin::setChunk(const std::string &data)
{
if (!effect) {
return;