mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-08 00:24:00 +00:00
g复string.startsWith不合理断言
Signed-off-by: hwx1163501 <hanjing35@huawei.com> issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I9FON0
This commit is contained in:
parent
13693445cd
commit
fe3a70f5c9
@ -270,7 +270,7 @@ template<typename T1, typename T2>
|
||||
bool IsSubStringAtSpan(Span<T1> &lhsSp, Span<T2> &rhsSp, uint32_t offset)
|
||||
{
|
||||
int rhsSize = static_cast<int>(rhsSp.size());
|
||||
ASSERT(rhsSize + offset < lhsSp.size());
|
||||
ASSERT(rhsSize + offset <= lhsSp.size());
|
||||
for (int i = 0; i < rhsSize; ++i) {
|
||||
auto left = static_cast<int32_t>(lhsSp[offset + i]);
|
||||
auto right = static_cast<int32_t>(rhsSp[i]);
|
||||
|
@ -96,3 +96,4 @@ false
|
||||
true
|
||||
true
|
||||
sub_string test success!
|
||||
true
|
||||
|
@ -263,3 +263,7 @@ let arr = Array(14);
|
||||
let tree_str = arr + 512;
|
||||
tree_str.substring(0,arr.length);
|
||||
print("sub_string test success!");
|
||||
|
||||
const v0 = [3.0,-1.5053];
|
||||
const v4 = v0.join();
|
||||
print(v4.startsWith(v4,v0))
|
||||
|
Loading…
Reference in New Issue
Block a user