Return help

can anyone telll me a short way to return bool value wheather it is true or not without checking flag is there a short way
bool containsDuplicate(vector& nums) {
long long int size=nums.size();
long int flag=1;
sort(nums.begin(),nums.end());
for(int i=0,j=i+1;i<size,j<size;i++,j++)
{
if(nums[i]==nums[j])
{
flag=0;
}
}
if(flag==0)
** {**
** return true;**
** }**
** else**
** {**
** return false;**
** }**

}

directly return true in the loop
if(nums[i]==nums[j])
return true;

and after exiting the whole loop return false

yeah i was also thought that one