Skip to content
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

Make event_source a polymorphic type #40040

Merged
merged 1 commit into from
May 1, 2020

Conversation

jbytheway
Copy link
Contributor

Summary

SUMMARY: None

Purpose of change

Every function in event_source was an if statement for the two different possibilities. This is a code smell that suggests we ought to be using two derived classes and dynamic dispatch instead.

Describe the solution

Do that.

As a side-effect, the unique_value statistic gained support for both varieties of event_source.

Describe alternatives you've considered

Leaving it as-is.

Testing

Unit tests.

Every function in event_source was an if statement for the two different
possibilities.  This is a code smell that suggests we ought to be using
two derived classes and dynamic dispatch instead.  So, do that.

No change to functionality intended.
@ifreund ifreund added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels May 1, 2020
Copy link
Contributor

@ifreund ifreund left a comment

Choose a reason for hiding this comment

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

Thanks!

@ifreund ifreund merged commit 8bea388 into CleverRaven:master May 1, 2020
@jbytheway jbytheway deleted the polymorphic_event_source branch May 1, 2020 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants