mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: replace same_weightsystem() by operator==()
The important point is that this now takes a reference that avoid string copying. The old code used C-strings and therefore copy-semantics were OK. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
fb3a157462
commit
777e7f32a5
4 changed files with 8 additions and 7 deletions
|
|
@ -172,10 +172,10 @@ void add_cylinder(struct cylinder_table *t, int idx, cylinder_t cyl)
|
|||
t->insert(t->begin() + idx, std::move(cyl));
|
||||
}
|
||||
|
||||
bool same_weightsystem(weightsystem_t w1, weightsystem_t w2)
|
||||
bool weightsystem_t::operator==(const weightsystem_t &w2) const
|
||||
{
|
||||
return w1.weight.grams == w2.weight.grams &&
|
||||
w1.description == w2.description;
|
||||
return std::tie(weight.grams, description) ==
|
||||
std::tie(w2.weight.grams, w2.description);
|
||||
}
|
||||
|
||||
void get_gas_string(struct gasmix gasmix, char *text, int len)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue