-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Update api_who_reacted.cpp #27774
base: dev
Are you sure you want to change the base?
Update api_who_reacted.cpp #27774
Conversation
I split the original RegenerateParticipants function into two separate functions: UpdateExistingParticipants and AddNewParticipants
This code improves readability and structure by using functional transformations and filtering, as well as explicitly updating userpics
I couldn't think of a reason it must've done this way. It's unnecessary to generate two independent thunks of machine code that will only be called sequentially, especially when building with LTO. |
He explains it and it is a very valid reason
|
const std::vector<PeerWithReaction> &ids) { | ||
auto &owner = item->history()->owner(); | ||
|
||
struct ResolvedPeer { |
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 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.
J
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.
lol
Now I split the original
RegenerateParticipants
function into two separate functions:UpdateExistingParticipants
andAddNewParticipants
. The first one updates information about existing participants, while the second one adds new participants. NowRegenerateParticipants
calls these two functions sequentially to update the participants list. This improves the code structure, making it more understandable and modular.