mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-07 08:03:29 +00:00
回退4369
Signed-off-by: hwx1163501 <hanjing35@huawei.com> issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I7KI26
This commit is contained in:
parent
ced0169895
commit
19faeb8fec
@ -439,14 +439,14 @@ bool JSArray::IncludeInSortedValue(JSThread *thread, const JSHandle<JSTaggedValu
|
||||
{
|
||||
ASSERT(obj->IsJSArray());
|
||||
JSHandle<JSArray> arrayObj = JSHandle<JSArray>::Cast(obj);
|
||||
uint32_t length = arrayObj->GetArrayLength();
|
||||
int32_t length = static_cast<int32_t>(arrayObj->GetArrayLength());
|
||||
if (length == 0) {
|
||||
return false;
|
||||
}
|
||||
uint32_t left = 0;
|
||||
uint32_t right = length - 1;
|
||||
int32_t left = 0;
|
||||
int32_t right = length - 1;
|
||||
while (left <= right) {
|
||||
uint32_t middle = (left + right) / 2;
|
||||
int32_t middle = (left + right) / 2;
|
||||
JSHandle<JSTaggedValue> vv = JSArray::FastGetPropertyByValue(thread, obj, middle);
|
||||
ComparisonResult res = JSTaggedValue::Compare(thread, vv, value);
|
||||
if (res == ComparisonResult::EQUAL) {
|
||||
|
Loading…
Reference in New Issue
Block a user