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:
HyukWoo Park 2020-10-05 17:39:16 +09:00 committed by Boram Bae
commit f168e4bd7b
30 changed files with 35 additions and 111 deletions

View file

@ -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;