-
Notifications
You must be signed in to change notification settings - Fork 1
Release 0.6.6 #13
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
Release 0.6.6 #13
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,13 +266,11 @@ public virtual void Add(TKey key, TValue value) | |
/// <inheritdoc /> | ||
public virtual bool Remove(TKey key) | ||
{ | ||
if (!Dictionary.TryGetValue(key, out var value)) | ||
if (!Dictionary.TryGetValue(key, out var value) || !Dictionary.Remove(key)) | ||
{ | ||
return false; | ||
} | ||
|
||
Dictionary.Remove(key); | ||
|
||
if (ObservableUpdateFlag != ObservableUpdateFlag.UpdateOnly && _keyUpdateActions.TryGetValue(key, out var actions)) | ||
{ | ||
for (var i = actions.Count - 1; i > -1; i--) | ||
Comment on lines
266
to
276
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The code change in this hunk is aimed at fixing the behavior of the The changes made in this hunk are correct and address the issue. However, there are a few suggestions to improve the code further:
if (!Dictionary.TryGetValue(key, out var value) && !Dictionary.Remove(key))
{
return false;
}
return Dictionary.TryGetValue(key, out var value) && Dictionary.Remove(key); By making these changes, the code becomes more concise and easier to understand. Overall, the changes in this hunk are correct, but the suggested improvements can enhance the code further. |
||
|
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 code change in the
add
function fixes a syntax error. Thereturn
keyword is misspelled asretrn
. The corrected code should be: