joemelt101 / gamer-net

Provides a place for people to find others to play their favorite games with.
GNU General Public License v3.0
0 stars 3 forks source link

friend listing for friends page is innefficient #153

Open HomerGaidarski opened 8 years ago

HomerGaidarski commented 8 years ago

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.

HomerGaidarski commented 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)