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

Fix some bugs due to recent additions and certain options #864

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

killerwife
Copy link
Contributor

No description provided.

@jackpoz
Copy link
Contributor

jackpoz commented Jun 23, 2024

Could use ?. and ?? operators

@killerwife
Copy link
Contributor Author

You mean packet.Writer?.ToString() ?? "" ?

I just really dont like that reading wise :D

@Fabi
Copy link
Contributor

Fabi commented Jun 23, 2024

You mean packet.Writer?.ToString() ?? "" ?

I just really dont like that reading wise :D

Personal preference most likely but a packet.Writer?.ToString() ?? "" really makes it way nicer to read. Obviously we are at the "if you know what it does thing", but that would not be a valid reason against using things.

And if you do not like using duplicate code for such things at many places either you can just create an extension method like public static string ToStringSomething(this StringBuilder sb) => sb?.ToString() ?? ""; too :D

@killerwife
Copy link
Contributor Author

I have a hot take, instead of hiding the implementation behind a member static function, make the field nullable so everyone knows it can be null :D

@killerwife
Copy link
Contributor Author

Snarky comments aside, force pushed with the syntax adjustment.

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