Skip to content

Refactor: simplify setting of useArrayBounds #4562

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

Merged
merged 1 commit into from
Apr 6, 2015

Conversation

WalterBright
Copy link
Member

  1. Add enum to convey meaning.
  2. Straighten out overly complex logic.
  3. Alphabetize commands in help message.

Refactor only - should not be any change in functionality.

char useArrayBounds; // 0: no array bounds checks
// 1: array bounds checks for safe functions only
// 2: array bounds checks for all functions
char useArrayBounds; // enum BOUNDSCHECK
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use BOUNDSCHECK as the type

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@WalterBright WalterBright force-pushed the refactorBoundscheck branch 2 times, most recently from 003d252 to 3eee9df Compare April 6, 2015 06:23
@brad-anderson
Copy link
Member

Good. When I add boundcheck I hadn't really changed anything serious with dmd before so I tried to not rock the boat too much and made it very similar to what was already there, though I was cognizant of how ugly it was when I added it (I believe @AndrejMitrovic pointed it out during the review too).

This is much better.

@WalterBright
Copy link
Member Author

Making things flow better is always an ongoing learning process, for myself included. I generally hate all the code I wrote more than a couple years back.

@yebblies
Copy link
Member

yebblies commented Apr 6, 2015

Auto-merge toggled on

yebblies added a commit that referenced this pull request Apr 6, 2015
Refactor: simplify setting of useArrayBounds
@yebblies yebblies merged commit a3bfcc0 into dlang:master Apr 6, 2015
@WalterBright WalterBright deleted the refactorBoundscheck branch April 6, 2015 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants