Skip to content

Commit

Permalink
Use 'using std::set'
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl authored and speth committed Aug 3, 2023
1 parent 42ed2be commit 6ba497c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion include/cantera/base/AnyMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ class AnyMap : public AnyBase

//! Return an unordered set of keys
//! @since New in %Cantera 3.0.
std::set<std::string> keys() const;
set<string> keys() const;

//! Set a metadata value that applies to this AnyMap and its children.
//! Mainly for internal use in reading or writing from files.
Expand Down
4 changes: 2 additions & 2 deletions src/base/AnyMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1461,9 +1461,9 @@ std::string AnyMap::keys_str() const
return to_string(b);
}

std::set<std::string> AnyMap::keys() const
set<string> AnyMap::keys() const
{
std::set<std::string> out;
set<string> out;
auto iter = this->begin();
while (iter != this->end()) {
out.insert(iter->first);
Expand Down
2 changes: 1 addition & 1 deletion src/base/YamlWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ std::string YamlWriter::toYamlString() const
output["date"].setLoc(-2, 0);

// Add remaining header information, ignoring obsolete information
std::set<std::string> exclude = {
set<string> exclude = {
"description", "generator", "cantera-version", "git-commit", "date"};
for (const auto& [key, value] : m_header) {
if (!exclude.count(key)) {
Expand Down
7 changes: 3 additions & 4 deletions src/base/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,8 @@ class Application
//! Versions of Python to consider when attempting to load user extensions
vector<string> m_pythonSearchVersions = {"3.11", "3.10", "3.9", "3.8"};

//! Vector of deprecation warnings that have been emitted (to suppress
//! duplicates)
std::set<std::string> warnings;
//! Set of deprecation warnings that have been emitted (to suppress duplicates)
set<string> warnings;

bool m_suppress_deprecation_warnings = false;
bool m_fatal_deprecation_warnings = false;
Expand All @@ -448,7 +447,7 @@ class Application
bool m_fatal_warnings = false;
bool m_use_legacy_rate_constants = false;

std::set<std::pair<std::string, std::string>> m_loaded_extensions;
set<pair<string, string>> m_loaded_extensions;

ThreadMessages pMessenger;

Expand Down
2 changes: 1 addition & 1 deletion src/oneD/Domain1D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ AnyMap Domain1D::getMeta() const
auto wrap_tols = [this](const vector_fp& tols) {
// If all tolerances are the same, just store the scalar value.
// Otherwise, store them by component name
std::set<double> unique_tols(tols.begin(), tols.end());
set<double> unique_tols(tols.begin(), tols.end());
if (unique_tols.size() == 1) {
return AnyValue(tols[0]);
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/oneD/StFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ AnyMap StFlow::getMeta() const
state["emissivity-right"] = m_epsilon_right;
}

std::set<bool> energy_flags(m_do_energy.begin(), m_do_energy.end());
set<bool> energy_flags(m_do_energy.begin(), m_do_energy.end());
if (energy_flags.size() == 1) {
state["energy-enabled"] = m_do_energy[0];
} else {
Expand All @@ -746,7 +746,7 @@ AnyMap StFlow::getMeta() const

state["Soret-enabled"] = m_do_soret;

std::set<bool> species_flags(m_do_species.begin(), m_do_species.end());
set<bool> species_flags(m_do_species.begin(), m_do_species.end());
if (species_flags.size() == 1) {
state["species-enabled"] = m_do_species[0];
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/thermo/Species.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ unique_ptr<Species> newSpecies(const AnyMap& node)

// Store input parameters in the "input" map, unless they are stored in a
// child object
const static std::set<std::string> known_keys{
const static set<string> known_keys{
"thermo", "transport"
};
s->input.setUnits(node.units());
Expand Down

0 comments on commit 6ba497c

Please sign in to comment.