Which is more efficient in binary search? Declaring int m outside while loop or inside.

2 ways of declaring m.

int left=0, right = nums.length-1, m;

while (left<=right){
	m = left + (right - left)/2;
}

and

int left = 0, right = nums.length-1;

while(left<=right){
	int m = left + (right-left)/2;
}

Outside while loop and inside. Which one is better?

Comments (3)