fix content stats

This commit is contained in:
MihailRis
2024-12-29 20:28:45 +03:00
parent 7132bb0758
commit 97eef3ef19
2 changed files with 24 additions and 15 deletions
+3 -1
View File
@@ -35,11 +35,13 @@ public:
: allNames(allNames), type(type) {
}
T& create(const std::string& id) {
T& create(const std::string& id, bool* created = nullptr) {
auto found = defs.find(id);
if (found != defs.end()) {
if (created) *created = false;
return *found->second;
}
if (created) *created = true;
checkIdentifier(id);
allNames[id] = type;
names.push_back(id);