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

chore: Use optional arguments where appropriate #65

Merged
merged 6 commits into from
Jun 17, 2022

Conversation

malandis
Copy link
Contributor

@malandis malandis commented Jun 17, 2022

This PR refactors the code to use optional arguments where appropriate. Many methods were extraneous because of this, so we can now delete a lot of repeated code, eg:

public CacheSetResponse Set(string cacheName, string key, string value, uint ttlSeconds) {}
// ...
public CacheSetResponse Set(string cacheName, string key, string value) {}

becomes

public CacheSetResponse Set(string cacheName, string key, string value, uint? ttlSeconds = null)

Where the default for ttlSeconds is set in one place.

@malandis malandis changed the title chore: Use optional arguments where possible chore: Use optional arguments where appropriate Jun 17, 2022
@malandis malandis marked this pull request as draft June 17, 2022 17:41
@malandis malandis marked this pull request as ready for review June 17, 2022 17:45
@malandis malandis marked this pull request as draft June 17, 2022 17:46
@malandis malandis marked this pull request as ready for review June 17, 2022 17:47
@malandis malandis merged commit 42f76fb into main Jun 17, 2022
@malandis malandis deleted the chore/use-optional-arguments branch June 17, 2022 17:56
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.

2 participants