mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Remove unused codes found by cppcheck
* remove unused functions * remove unused variables * mark necessary but unused variables with UNUSED_VARIABLE Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
parent
a1b464f24a
commit
f168e4bd7b
30 changed files with 35 additions and 111 deletions
|
|
@ -332,7 +332,6 @@ bool RegExpObject::match(ExecutionState& state, String* str, RegexMatchResult& m
|
|||
bool isGlobal = option() & RegExpObject::Option::Global;
|
||||
bool isSticky = option() & RegExpObject::Option::Sticky;
|
||||
bool gotResult = false;
|
||||
bool reachToEnd = false;
|
||||
unsigned* outputBuf = ALLOCA(sizeof(unsigned) * 2 * (subPatternNum + 1), unsigned int, state);
|
||||
outputBuf[1] = start;
|
||||
do {
|
||||
|
|
@ -414,9 +413,6 @@ bool RegExpObject::match(ExecutionState& state, String* str, RegexMatchResult& m
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if (start) {
|
||||
reachToEnd = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} while (result != JSC::Yarr::offsetNoMatch);
|
||||
|
|
@ -461,18 +457,6 @@ void RegExpObject::createRegexMatchResult(ExecutionState& state, String* str, Re
|
|||
} while (testResult);
|
||||
}
|
||||
|
||||
ArrayObject* RegExpObject::createMatchedArray(ExecutionState& state, String* str, RegexMatchResult& result)
|
||||
{
|
||||
ArrayObject* ret = new ArrayObject(state);
|
||||
createRegexMatchResult(state, str, result);
|
||||
size_t len = result.m_matchResults.size();
|
||||
ret->setThrowsException(state, state.context()->staticStrings().length, Value(len), ret);
|
||||
for (size_t idx = 0; idx < len; idx++) {
|
||||
ret->defineOwnProperty(state, ObjectPropertyName(state, Value(idx)), ObjectPropertyDescriptor(Value(new StringView(str, result.m_matchResults[idx][0].m_start, result.m_matchResults[idx][0].m_end)), ObjectPropertyDescriptor::AllPresent));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
ArrayObject* RegExpObject::createRegExpMatchedArray(ExecutionState& state, const RegexMatchResult& result, String* input)
|
||||
{
|
||||
uint64_t len = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue