From 7afab4ad5662b394bedd2bd5be2f7a4dba3bbb5e Mon Sep 17 00:00:00 2001 From: Sean Jones Date: Mon, 25 Nov 2013 20:54:46 +0000 Subject: [PATCH] Cppcheck suggested performance improvement variables should be passed by reference. They are passed by value. It could be passed as a (const) reference which is usually faster and recommended in C++. This gives a 9% performance boost in my project. 26.28s to load instead of 28.94s --- tiny_obj_loader.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tiny_obj_loader.cc b/tiny_obj_loader.cc index 8b057821..bd3b3f27 100644 --- a/tiny_obj_loader.cc +++ b/tiny_obj_loader.cc @@ -196,12 +196,12 @@ updateVertex( static bool exportFaceGroupToShape( shape_t& shape, - const std::vector in_positions, - const std::vector in_normals, - const std::vector in_texcoords, + const std::vector &in_positions, + const std::vector &in_normals, + const std::vector &in_texcoords, const std::vector >& faceGroup, - const material_t material, - const std::string name) + const material_t &material, + const std::string &name) { if (faceGroup.empty()) { return false;