mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Apply suggestions from code review
Accessing cell/material names through accessor. Returning a const reference from `name()` accessor in both cases. Co-Authored-By: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
331e198617
commit
d820e6777a
4 changed files with 4 additions and 4 deletions
|
|
@ -136,7 +136,7 @@ public:
|
|||
|
||||
//! Get the name of a cell
|
||||
//! \return Cell name
|
||||
std::string name() const { return name_; };
|
||||
const std::string& name() const { return name_; };
|
||||
|
||||
//! Set the temperature of a cell instance
|
||||
//! \param[in] name Cell name
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ public:
|
|||
|
||||
//! Get name
|
||||
//! \return Material name
|
||||
std::string name() const { return name_; }
|
||||
const std::string& name() const { return name_; }
|
||||
|
||||
//! Set name
|
||||
void set_name(const std::string& name) { name_ = name; }
|
||||
|
|
|
|||
|
|
@ -1089,7 +1089,7 @@ openmc_cell_get_name(int32_t index, const char** name) {
|
|||
return OPENMC_E_OUT_OF_BOUNDS;
|
||||
}
|
||||
|
||||
*name = model::cells[index]->name_.data();
|
||||
*name = model::cells[index]->name().data();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1388,7 +1388,7 @@ openmc_material_get_name(int32_t index, const char** name) {
|
|||
return OPENMC_E_OUT_OF_BOUNDS;
|
||||
}
|
||||
|
||||
*name = model::materials[index]->name_.data();
|
||||
*name = model::materials[index]->name().data();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue