I have to switch my user role into roles (list), so I’m wondering what the most efficient way to compare the two is.
If at least one match happens between the two lists I return true. Is this best made into a function in a cfc?
Only other option is looping through one list and listFind in the other. Seems like there should be a listCollision() function or something of the sort that returns matching values or a count on how many values match.
i like how coldfusion disregards empty list elements, e.g. ‘one,two,three’ has only 3 elements
too bad it can’t be told to disregard duplicate elements in the same way
so here’s an approach which doesn’t require a ListFind inside a loop, it just combines and sorts the lists and then uses a single loop to compare adjacent items