From cbf50d0a25601603072ddd9f3e6d6f4f9f312f02 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Thu, 12 Dec 2024 22:20:36 +0100 Subject: [PATCH] Fix string comparison --- Generators/src/GeneratorHybrid.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Generators/src/GeneratorHybrid.cxx b/Generators/src/GeneratorHybrid.cxx index 9c3957de9e335..a47a6c9fdd5b0 100644 --- a/Generators/src/GeneratorHybrid.cxx +++ b/Generators/src/GeneratorHybrid.cxx @@ -382,11 +382,11 @@ Bool_t GeneratorHybrid::parseJSON(const std::string& path) // check if there is a mode field if (doc.HasMember("mode")) { const auto& mode = doc["mode"].GetString(); - if (mode == "sequential") { + if (strcmp(mode, "sequential") == 0) { // events are generated in the order given by fractions or random weight mGenerationMode = GenMode::kSeq; } - if (mode == std::string("parallel")) { + if (strcmp(mode, "parallel") == 0) { // events are generated fully in parallel and the order will be random // this is mainly for event pool generation or mono-type generators mGenerationMode = GenMode::kParallel; @@ -475,4 +475,4 @@ Bool_t GeneratorHybrid::parseJSON(const std::string& path) } // namespace eventgen } // namespace o2 -ClassImp(o2::eventgen::GeneratorHybrid); \ No newline at end of file +ClassImp(o2::eventgen::GeneratorHybrid);