summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index b7b97dc80f9..d987be84af2 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -320,26 +320,25 @@ void Item_func_interval::split_sum_func(List<Item> &fields)
longlong Item_func_interval::val_int()
{
- double value=item->val();
+ double value= item->val();
if (item->null_value)
- return -1; // -1 if null /* purecov: inspected */
+ return -1; // -1 if NULL
if (intervals)
{ // Use binary search to find interval
- uint start,end;
- start=0; end=arg_count-1;
+ uint start= 0, end= arg_count - 1;
while (start != end)
{
- uint mid=(start+end+1)/2;
+ uint mid= (start + end + 1) / 2;
if (intervals[mid] <= value)
- start=mid;
+ start= mid;
else
- end=mid-1;
+ end= mid - 1;
}
- return (value < intervals[start]) ? 0 : start+1;
+ return (value < intervals[start]) ? 0 : start + 1;
}
if (args[0]->val() > value)
return 0;
- for (uint i=1 ; i < arg_count ; i++)
+ for (uint i= 1; i < arg_count; i++)
{
if (args[i]->val() > value)
return i;