mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-27 22:01:02 +08:00
Binary search fix.
git-svn-id: https://protobuf-c.googlecode.com/svn/trunk@203 00440858-1255-0410-a3e6-75ea37f81c3a
This commit is contained in:
parent
69bf014a41
commit
c255a6fa0b
@ -1891,7 +1891,7 @@ protobuf_c_enum_descriptor_get_value_by_name
|
||||
return desc->values + desc->values_by_name[mid].index;
|
||||
else if (rv < 0)
|
||||
{
|
||||
count = start + count - (mid - 1);
|
||||
count = start + count - (mid + 1);
|
||||
start = mid + 1;
|
||||
}
|
||||
else
|
||||
@ -1974,7 +1974,7 @@ protobuf_c_service_descriptor_get_method_by_name
|
||||
return desc->methods + desc->method_indices_by_name[mid];
|
||||
if (rv < 0)
|
||||
{
|
||||
count = start + count - (mid - 1);
|
||||
count = start + count - (mid + 1);
|
||||
start = mid + 1;
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user