db/simple/DirectorySave: pass std::string_view to _load_subdir()
Eliminates one strlen() call.
This commit is contained in:
parent
57fb153c5d
commit
3c240e2119
@ -121,10 +121,11 @@ ParseLine(Directory &directory, const char *line)
|
||||
}
|
||||
|
||||
static Directory *
|
||||
directory_load_subdir(TextFile &file, Directory &parent, const char *name)
|
||||
directory_load_subdir(TextFile &file, Directory &parent, std::string_view name)
|
||||
{
|
||||
if (parent.FindChild(name) != nullptr)
|
||||
throw FormatRuntimeError("Duplicate subdirectory '%s'", name);
|
||||
throw FormatRuntimeError("Duplicate subdirectory '%.*s'",
|
||||
int(name.size()), name.data());
|
||||
|
||||
Directory *directory = parent.CreateChild(name);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user