Created
February 18, 2018 19:29
-
-
Save vardanator/8d0fc0ee80d1b220b2b1d4f9a77768e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 'author' represents the User object, at this point we are interested only in author.id | |
| // | |
| // 'tw' is a Tweet object, at this point we are interested only in 'tw.id' | |
| void DeliverATweet(User* author, Tweet* tw) | |
| { | |
| // we assume that 'tw' object is already stored in a database | |
| // 1. Get the list of user's followers (author of the tweet) | |
| vector<User*> user_followers = GetUserFollowers(author->id); | |
| for (auto follower : user_followers) { | |
| InsertTweetIntoUserTimeline(follower->id, tw->id); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment