Cleanup after RYML merge (#6785)

Speeded things up even more by making use of C++'s reference feature.
Fixed #6770 warning while at it.
Added back support for case insensitive booleans.
Fixed a very rare issue with cached databases.
Removed .children() calls
Added back type safety reports
Added ryml to login-server makefile

Thanks to @aleos89, @Atemo and @idk-whoami
This commit is contained in:
Lemongrass3110
2022-04-03 04:02:13 +02:00
committed by GitHub
parent b3343df2ab
commit 01261dbf3d
42 changed files with 350 additions and 334 deletions

View File

@@ -49,7 +49,7 @@ const std::string InstanceDatabase::getDefaultLocation() {
* @param node: YAML node containing the entry.
* @return count of successfully parsed rows
*/
uint64 InstanceDatabase::parseBodyNode(const ryml::NodeRef node) {
uint64 InstanceDatabase::parseBodyNode(const ryml::NodeRef& node) {
int32 instance_id = 0;
if (!this->asInt32(node, "Id", instance_id))
@@ -150,7 +150,7 @@ uint64 InstanceDatabase::parseBodyNode(const ryml::NodeRef node) {
}
if (this->nodeExists(node, "Enter")) {
const auto enterNode = node["Enter"];
const auto& enterNode = node["Enter"];
if (!this->nodesExist(enterNode, { "Map", "X", "Y" }))
return 0;
@@ -191,9 +191,9 @@ uint64 InstanceDatabase::parseBodyNode(const ryml::NodeRef node) {
}
if (this->nodeExists(node, "AdditionalMaps")) {
const auto mapNode = node["AdditionalMaps"];
const auto& mapNode = node["AdditionalMaps"];
for (const auto mapIt : mapNode.children()) {
for (const auto& mapIt : mapNode) {
std::string map;
c4::from_chars(mapIt.key(), &map);