erincatto / box2d

Box2D is a 2D physics engine for games
https://box2d.org
MIT License
8.09k stars 1.52k forks source link

Removing dead code in b2_chain_shape #656

Closed Nek- closed 3 years ago

Nek- commented 3 years ago

I believe there's a piece of dead code here since there's an assertion at the previous statement that will fail in case it's under 3.

I caught many other places like this one. So I started to think that box2d is designed to run without assert activated. The problem is that at some places in the case of assertion the code continues, is it expected or something that should be changed?

Example: https://github.com/erincatto/box2d/blob/ee4e1c7a2a21dd2b4ce53a9b61c51f51e8adbc9a/src/collision/b2_chain_shape.cpp#L70-L76

erincatto commented 3 years ago

Sorry, I don't accept this sort of PR. If you think there is a bug, please file an issue. This case does not appear to be a bug.