-
Notifications
You must be signed in to change notification settings - Fork 595
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
Code cleanups #931
Code cleanups #931
Conversation
For an example of the most drastic changes and code reductions, see https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/931/files#diff-0ea0e0e737f90115933e0196f709f5b8 for example. |
@@ -662,14 +440,12 @@ private void Init(IFrameHandler fh) | |||
} | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: extra line
lock (_eventLock) | ||
{ | ||
_connectionShutdown -= value; | ||
} | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: extra line
|
||
public uint FrameMax { get; set; } | ||
|
||
public TimeSpan Heartbeat | ||
{ | ||
get { return _heartbeat; } | ||
get => _heartbeat; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we even need the field here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not. I haven't cleaned up fields and made auto properties where possible everywhere yet.
@@ -99,55 +99,62 @@ public static void DumpKeyValue(string key, object value, TextWriter writer, int | |||
///<summary>Dump properties of objects to the supplied writer.</summary> | |||
public static void DumpProperties(object value, TextWriter writer, int indent) | |||
{ | |||
if (value == null) | |||
switch (value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we lock the csharp version to not accidentally use something that would not be compatible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use the default csharp version it target the lowest common denominator based on the TargetFrameworks. Bit if needed we can lock it to 7.3 according to this: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/configure-language-version
It would be very nice to have a version of this for |
Proposed Changes
Loads of code cleanups:
x is null
instead ofx == null
. Also prevents accidental bugs in case==
operator would ever be overloaded.readonly
where possible.if
s toswitch
where possible.Types of Changes
Checklist
CONTRIBUTING.md
document