Skip to content

Optimize EntitySetState #241

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

Merged
merged 3 commits into from
Aug 21, 2024
Merged

Optimize EntitySetState #241

merged 3 commits into from
Aug 21, 2024

Conversation

SergeiPavlov
Copy link
Collaborator

@SergeiPavlov SergeiPavlov commented Aug 21, 2024

  • Use HashSet<Key> instead of Dictionary<Key, Key>
  • Convert BackedUpState to record struct for locality
  • Convert KeyMapping to readonly struct

@SergeiPavlov SergeiPavlov requested a review from botinko August 21, 2024 18:02
{
IsLoaded = state.IsLoaded;
TotalItemCount = state.TotalItemCount;
AddedKeys = state.addedKeys.Values.ToList();
Copy link

@botinko botinko Aug 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, but previosly, BackupedState was responsible to create a copy of AddedKeys , RemovedKeys. But now it's up to caller. API/Behavior is not consistent, as you can pass everything, that can be changed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an API, it is private class used in single place.

@SergeiPavlov SergeiPavlov merged commit 00acb70 into master-servicetitan Aug 21, 2024
4 checks passed
@SergeiPavlov SergeiPavlov deleted the EntitySetState branch August 21, 2024 20:24
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