How can I make this better?
public int BubbleSortNonEfficient(int[] arr) {
int temp = 0;
int LoopCount = 0;
for(int write = 0; write < arr.Length; write++) {
for(int sort = 0; sort < arr.Length - 1; sort++) {
LoopCount++;
if(arr[sort] > arr[sort + 1]) {
temp = arr[sort + 1];
arr[sort + 1] = arr[sort];
arr[sort] = temp;
}
}
}
return LoopCount;
}