EthanThatOneKid / acmcsuf.com

🐘 Official website of CSUF's ACM chapter
https://acmcsuf.com
MIT License
38 stars 46 forks source link

Unused tier indices #904

Closed EthanThatOneKid closed 11 months ago

EthanThatOneKid commented 12 months ago

Taking a look at the codebase, I noticed the TIERS constant was not being employed as intended. Here is the culprit: we are currently sorting board members by tier ID when we should be sorting board members by the tier index associated with that tier ID. This mistake was not immediately clear due to the sort continuously exhibiting expected behavior, but not for the correct reason.

Edit (clarification): Tier IDs happen to be sorted in the same way as their respective indices. However, they might not always be that way. Hence the coincidence of showing expected behavior.

https://github.com/EthanThatOneKid/acmcsuf.com/blob/b5c26cb516a33fb5254f455f7fabbd999041ebfb/src/routes/(site)/about/officer-profile-list.svelte#L32

Suggestion:

return TIERS[aPos.tier].index - TIERS[bPos.tier].index;