plugin/Manager: migrate to std::string_view

This commit is contained in:
Max Kellermann 2020-02-04 12:54:08 +01:00
parent 95e646fca7
commit 298fd125ae
2 changed files with 5 additions and 3 deletions

View file

@ -478,9 +478,9 @@ Manager::bif_init_func_map* Manager::BifFilesInternal()
return bifs;
}
Plugin* Manager::LookupPluginByPath(std::string path)
Plugin* Manager::LookupPluginByPath(std::string_view _path)
{
path = normalize_path(path);
auto path = normalize_path(_path);
if ( is_file(path) )
path = SafeDirname(path).result;

View file

@ -4,6 +4,8 @@
#include <utility>
#include <map>
#include <string_view>
#include "Plugin.h"
#include "Component.h"
@ -153,7 +155,7 @@ public:
* path. The path can be the plugin directory itself, or any path
* inside it.
*/
Plugin* LookupPluginByPath(std::string path);
Plugin* LookupPluginByPath(std::string_view path);
/**
* Returns true if there's at least one plugin interested in a given