Commit 3c240e21 authored by Max Kellermann's avatar Max Kellermann

db/simple/DirectorySave: pass std::string_view to _load_subdir()

Eliminates one strlen() call.
parent 57fb153c
...@@ -121,10 +121,11 @@ ParseLine(Directory &directory, const char *line) ...@@ -121,10 +121,11 @@ ParseLine(Directory &directory, const char *line)
} }
static Directory * 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) 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); Directory *directory = parent.CreateChild(name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment