Skip to content

Commit d4737b3

Browse files
author
Kristoffer Eide
committed
#776 Revert unnecessary change. Compress code.
1 parent f544b06 commit d4737b3

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/cosim/observer/file_observer.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,7 @@ file_observer_config file_observer_config::parse(const filesystem::path& configP
567567
boost::property_tree::xml_parser::no_comments | boost::property_tree::xml_parser::trim_whitespace);
568568

569569
file_observer_config config;
570-
const auto simulators = ptree.get_child("simulators");
571-
for (const auto& simulator : simulators) {
570+
for (const auto& simulator : ptree.get_child("simulators")) {
572571
if (simulator.first == "simulator") {
573572
const auto modelName = get_attribute<std::string>(simulator.second, "name");
574573
const auto decimationFactor = get_optional_attribute<size_t>(simulator.second, "decimationFactor");
@@ -583,15 +582,12 @@ file_observer_config file_observer_config::parse(const filesystem::path& configP
583582
}
584583
}
585584
if (const auto configuration = ptree.get_child_optional("configuration")) {
586-
const auto timestamps = get_optional_attribute<bool>(*configuration, "timestampedFilenames");
587-
if (timestamps) {
585+
if (const auto timestamps = get_optional_attribute<bool>(*configuration, "timestampedFilenames")) {
588586
config.set_timestamped_filenames(*timestamps);
589587
}
590-
const auto precision = get_optional_attribute<int>(*configuration, "floatingPointPrecision");
591-
if (precision) {
588+
if (const auto precision = get_optional_attribute<int>(*configuration, "floatingPointPrecision")) {
592589
config.fixed_precision(*precision);
593590
}
594-
595591
}
596592

597593
return config;

0 commit comments

Comments
 (0)