Better performance for AI checking enemies are visible for AI?

im assuming that your using something like an array when checking for the closest (ordering array based on proximity). if thats the case then why not just check visibility based on whos closest. basically go down your list: is index 1 visible no then move on, is index 2 visible yes ok hes our target. that method will at least limit how many traces you need to do. if you base the vis checks on whos close then you will be checking the enemies most likely to be visible the most often.