Skip to content
Commit 0f33e383 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment