| 906 | |
| 907 | |
| 908 | int in_vector::find(Item *item) |
| 909 | { |
| 910 | uchar *result=get_value(item); |
| 911 | if (!result || !used_count) |
| 912 | return 0; // Null value |
| 913 | |
| 914 | uint start,end; |
| 915 | start=0; end=used_count-1; |
| 916 | while (start != end) |
| 917 | { |
| 918 | uint mid=(start+end+1)/2; |
| 919 | int res; |
| 920 | if ((res=(*compare)(collation, base+mid*size, result)) == 0) |
| 921 | return 1; |
| 922 | if (res < 0) |
| 923 | start=mid; |
| 924 | else |
| 925 | end=mid-1; |
| 926 | } |
| 927 | return (int) ((*compare)(collation, base+start*size, result) == 0); |
| 928 | } |
| 929 | |
| 930 | in_string::in_string(uint elements,qsort2_cmp cmp_func, |
| 931 | const CHARSET_INFO *cs) |
no outgoing calls
no test coverage detected