Skip to content

Conversation

@kripken
Copy link
Member

@kripken kripken commented Nov 16, 2018

I found this helpful to reduce a testcase that had a huge switch. This tries to reduce by replacing targets with the default, and by shrinking the list of targets.

}
// Try to shorten the list of targets.
while (sw->targets.size() > 1) {
auto last = sw->targets.back();
Copy link
Member

Choose a reason for hiding this comment

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

can this just be pop_back()?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, fixed. Found a few more in this file too.

(Honestly beceause pop_back() doesn't return a value I think I just gave up and forgot about it...)

@kripken kripken merged commit 82685ae into master Nov 16, 2018
@kripken kripken deleted the reduce-switch branch November 16, 2018 18:44
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