You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code currently construction comment strings regardless of whether a contract violation has occurred. This can have significant performance implications. Ideally the string object should only be constructed on violation. We could alternatively preallocate all string messages, but that then makes it impossible to add context-specific information.
The text was updated successfully, but these errors were encountered:
One possibility is to make a macro similar to the CONTRACT_COMMENT macro that takes a boolean condition and comment string and to rewrite to a ternary that conditionally yields either an empty string or the comment string based on the boolean condition. Some quick benchmarking indicates this is slightly less performant than the CONTRACT_COMMENT approach (on the order of 2-3%), but maybe it's useful enough to add.
The code currently construction comment strings regardless of whether a contract violation has occurred. This can have significant performance implications. Ideally the string object should only be constructed on violation. We could alternatively preallocate all string messages, but that then makes it impossible to add context-specific information.
The text was updated successfully, but these errors were encountered: