浏览代码

Wrong object is created here!

If I'm not mistaken. Because this is originally push_back(aniMeshVertex) instead of push_back(v).
And the fact that aniMeshVertex is just getting created and destroyed for nothing.
It need to be replaced with this then? A Clang-tidy syntax to create the same aniMeshVertex.

I found this in pull request #4527 I think it may need to be reviewed too.
J.G.Adams 3 年之前
父节点
当前提交
9cd723e282
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      code/PostProcessing/JoinVerticesProcess.cpp

+ 1 - 2
code/PostProcessing/JoinVerticesProcess.cpp

@@ -345,8 +345,7 @@ int JoinVerticesProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex) {
             uniqueVertices.push_back(v);
             if (hasAnimMeshes) {
                 for (unsigned int animMeshIndex = 0; animMeshIndex < pMesh->mNumAnimMeshes; animMeshIndex++) {
-                    Vertex aniMeshVertex(pMesh->mAnimMeshes[animMeshIndex], a);
-                    uniqueAnimatedVertices[animMeshIndex].push_back(v);
+                    uniqueAnimatedVertices[animMeshIndex].emplace_back(pMesh->mAnimMeshes[animMeshIndex], a);
                 }
             }
         } else{