-
Notifications
You must be signed in to change notification settings - Fork 95
feat: PointData Immutability #96
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #96 +/- ##
==========================================
- Coverage 16.15% 15.85% -0.31%
==========================================
Files 49 49
Lines 4792 4883 +91
Branches 228 243 +15
==========================================
Hits 774 774
- Misses 3998 4089 +91
Partials 20 20
Continue to review full report at Codecov.
|
Thanks for PR! |
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.
Thanks again for this PR.
Could you please also update CHANGELOG.md
?
@@ -215,25 +246,29 @@ public PointData Timestamp(DateTimeOffset timestamp, WritePrecision timeUnit) | |||
/// <returns></returns> | |||
public PointData Timestamp(Instant timestamp, WritePrecision timeUnit) | |||
{ | |||
Precision = timeUnit; | |||
|
|||
BigInteger? time = null; |
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.
Please remove a redundant initializer => BigInteger? time;
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.
Can you clarify which redundant did you mean?
is it line 249? it doesn't seem redundant to me because it is a local variable not _time which is immutable.
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.
The assignment of null
is unnecessary because is not used in any execution path.
Client/Writes/PointData.cs
Outdated
var otherFields = other._fields; | ||
result = result && _fields.Count == otherFields.Count && | ||
_fields.All(pair => otherFields.ContainsKey(pair.Key) && | ||
object.Equals(otherFields[pair.Key], pair.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.
Please remove redundant qualifier => Equals(otherFields[pair.Key], pair.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.
The object
qualifier is unnecessary.
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.
There are only code style glitches and We will be ready to merge.
Fixed all var issues |
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.
Could you please revert 7af91a0 - "move PointData to Client.Core". We want to focus on one thing in PR. Please create a new PR for that.
I've prepared a patch for you:
How do I execute the patch? |
Sorry @bnayae, the patch was generated by JetBrains Rider... and should be applied by Rider Anyway here is a You can apply it by: git am --signoff < chore_revert_move_PointData_to_Client_Core-GIT.txt |
Signed-off-by: bnaya eshet <[email protected]>
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.
Thanks! 👍
Closes #93
Briefly describe your proposed changes:
Immutable PointData builder consider best practice especially when using RX & async operations.
It will prevent potential side effects.