Open HomerGaidarski opened 8 years ago
block() function in User class is also inefficient because it gets full list of friends and then checks to see if the user exists in the friend array, change to use getFriend function (searches for friend with specific id)
I just realized the way I query the list of friends is by getting only their id and type from the relationship table, and then using that id in the loadUserByID function (which does a query each time!). I should only have to query the database once to get all the friend info, see the way a user's games are loaded for help.