Skip to content

Commit

Permalink
Pass mesh as const& in write*obj to avoid unnecessary copy
Browse files Browse the repository at this point in the history
  • Loading branch information
patrikhuber committed Dec 4, 2019
1 parent 13f3add commit bba26ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/eos/core/write_obj.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace core {
* @param[in] mesh The mesh to save as obj.
* @param[in] filename Output filename (including ".obj").
*/
inline void write_obj(Mesh mesh, std::string filename)
inline void write_obj(const Mesh& mesh, std::string filename)
{
assert(mesh.vertices.size() == mesh.colors.size() || mesh.colors.empty());
assert(mesh.tvi.size() == mesh.tti.size() || mesh.tti.empty());
Expand Down Expand Up @@ -112,7 +112,7 @@ inline void write_obj(Mesh mesh, std::string filename)
* @param[in] mesh The mesh to save as obj.
* @param[in] filename Output filename, including .obj.
*/
inline void write_textured_obj(Mesh mesh, std::string filename)
inline void write_textured_obj(const Mesh& mesh, std::string filename)
{
assert(mesh.vertices.size() == mesh.colors.size() || mesh.colors.empty());
assert(!mesh.texcoords.empty());
Expand Down

0 comments on commit bba26ff

Please sign in to comment.