-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable conditional compilation #5
Comments
Can you be more specfic please ? What is your purpose for doing it ? |
I have some inner loop code, running on mobile devices, that needs to execute as quickly and efficiently as possible. During development, I would like the checks in place to catch logic errors. At runtime, I want to disable them, but only for these inner loop sections of code. (And yes, I measured, and removing the checks makes a difference in performance and energy usage.) If you add the ConditionalAttribute, it would then be possible to disable the checks for a specific code file with
Right now I have to put that ugly The downside to adding the attribute, as I mentioned, is that the checks will only be evaluated if you define Figured it didn't hurt to ask… |
I think that's a great feature @starkos |
I would like to have the ability to turn off the checks in certain conditions or areas of the code. Would you be open to a pull request that adds
[Conditional("PRECONDITIONS")]
to the methods, so they could be turned on and off by a define?It would require all users to define the symbols of course, which isn't ideal.
The text was updated successfully, but these errors were encountered: