Verbessere die CMake-Konfiguration zur Unterstützung von C++23, indem die Compiler-Auswahl dynamisch auf GCC 15 oder 13 basiert. Optimiere die Compiler-Flags für Leistung. In der Datenbankabfrage und im DirectorWorker werden konstante Referenzen und string_view verwendet, um die Leistung zu steigern. Reserviere Speicher für Vektoren in main.cpp zur Effizienzsteigerung.

This commit is contained in:
Torsten Schulz (local)
2025-08-31 23:34:02 +02:00
committed by Torsten (PC)
parent 1f43df6d41
commit 4bafc3a61c
7 changed files with 524 additions and 23 deletions

View File

@@ -37,14 +37,19 @@ void DirectorWorker::performTask() {
setCurrentStep("Get director actions");
db.prepare("QUERY_GET_DIRECTORS", QUERY_GET_DIRECTORS);
const auto directors = db.execute("QUERY_GET_DIRECTORS");
// Use const references and string_view for better performance
for (const auto &director: directors) {
if (director.at("may_produce") == "t") {
const auto& mayProduce = director.at("may_produce");
const auto& mayTransport = director.at("may_start_transport");
const auto& maySell = director.at("may_sell");
if (mayProduce == "t") {
startProductions(director);
}
if (director.at("may_start_transport") == "t") {
if (mayTransport == "t") {
startTransports(director);
}
if (director.at("may_sell") == "t") {
if (maySell == "t") {
startSellings(director);
}
}