Less intrusive fix for #717
In the original fix I was making convert() throw exceptions. However, we use a lot failed conversions when reading inputs. Since catching an exception is much more expensive than inspecting a returned bool, this was slowing down a lot some parts of the code In 0ed75e9d I solved the issue by allowing to throw only a few functions. Here I take a radically different approach: a new function (convertNoexcept) can be used like to old one, and returns a bool. The function convert just calls convertNoexcept and, if false, throws. In this manner there is no overhead expected at all with respect to the previous version of the code. In addition, the modifications are less intrusive. It is sufficient to replace convert with convertNoexcept in all the places where the returned bool was checked
parent
2ebc6e70
Please register or sign in to comment