microsoft / DirectXMesh

DirectXMesh geometry processing library
https://walbourn.github.io/directxmesh/
MIT License
786 stars 152 forks source link

Use map instead of multimap in WaveFrontReader.h #71

Closed infinitesnow closed 2 years ago

infinitesnow commented 2 years ago

If two vertices have the same vertexIdx, the second one will just not insert. One index will never map to different vertices.

In other words, once entered the loop at line 694, line 700 will always return - so no need to use a multimap.

walbourn commented 2 years ago

You are assuming that there are no hash conflicts. It turns out in practice you do get them. If I use your version of WaveFrontReader, I get many failures in the test suite.