Replace bool array by more compact vector#4067
Conversation
Signed-off-by: Stefan Weil <sw@weilnetz.de>
|
Related issue: #4062. |
|
This fails with a -1 index as noted in #4062. Also, a vector is not any more compact than a stack array because a vector is just an array with more c++ isms around it |
|
The old code caused an illegal memory r/w operation with index -1, while the new code raises an exception. That's a clear improvement, even if it does not fix your issue. And |
|
it only throws an exception if you use c++ exceptions which are often disabled due to perf and general usability problems (which is why we do it). A bool vector could be a bitmask underneath, but if it is, you take a perf hit instead - probably not a great tradeoff for a small stack var - especially since the compiler can optimize bool[] any way it sees fit |
No description provided.