Update StarDirectives.cpp

This commit is contained in:
Kae 2023-09-05 16:42:44 +10:00
parent 51d6e63dfe
commit c992d4f72a

View File

@ -98,8 +98,10 @@ void Directives::loadOperations() const {
} }
void Directives::parse(String&& directives) { void Directives::parse(String&& directives) {
if (directives.empty()) if (directives.empty()) {
shared.reset();
return; return;
}
List<Entry> newList; List<Entry> newList;
StringView view(directives); StringView view(directives);
@ -123,8 +125,10 @@ void Directives::parse(String&& directives) {
} }
}); });
if (newList.empty() && !prefix.empty()) if (newList.empty() && !prefix.empty()) {
shared.reset();
return; return;
}
shared = std::make_shared<Shared const>(move(newList), move(directives), prefix); shared = std::make_shared<Shared const>(move(newList), move(directives), prefix);
if (view.size() < 1000) { // Pre-load short enough directives if (view.size() < 1000) { // Pre-load short enough directives