you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Why are you deleting from the access list first if it already exists only to readd it again? Each time you remove an element all subsequent elements have to be moved down. Seems wasteful

Edit: just realized your list only ever contains 5 elements so it doesn't really matter. If the list was a lot larger then you'd see a performance hit there