Why would I put a break in? It iterates to find the smallest distance, Zero.
Having worked with professional development teams I can honestly say this is the cleanest bit of code I've written in months x.x I am not proud of this fact.
Some psuedocode:
PHP Code:
public int findSmallestIndex(int[] values){
initialize variable to hold index of smallest value ( -1 might be a good number here)
initialize variable to hold value of smallest value (Integer.MAX-VALUE might be a good number here)
for length of values
if i value < smallest value
smallest value = i value
smallest index = i
return i
}