Skip to content

Commit

Permalink
ScalarField: emplace_back -> push_back (#102)
Browse files Browse the repository at this point in the history
emplace_back is unnecessary and prevents some optimizations
  • Loading branch information
tpwrules authored May 4, 2024
1 parent cac3533 commit 300339e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/ScalarField.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace CCCoreLib
inline ScalarType& getValue(std::size_t index) { return at(index); }
inline const ScalarType& getValue(std::size_t index) const { return at(index); }
inline void setValue(std::size_t index, ScalarType value) { at(index) = value; }
inline void addElement(ScalarType value) { emplace_back(value); }
inline void addElement(ScalarType value) { push_back(value); }
inline unsigned currentSize() const { return static_cast<unsigned>(size()); }
inline void swap(std::size_t i1, std::size_t i2) { std::swap(at(i1), at(i2)); }

Expand Down

0 comments on commit 300339e

Please sign in to comment.