mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 03:12:56 +00:00
remove redundant casts from JavaScriptCore
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
9b6267878c
commit
28095b2a3e
2 changed files with 4 additions and 5 deletions
|
@ -2603,23 +2603,22 @@ JSRegExp* jsRegExpCompile(const UChar* pattern, int patternLength,
|
||||||
error, errorcode will be set non-zero, so we don't need to look at the result
|
error, errorcode will be set non-zero, so we don't need to look at the result
|
||||||
of the function here. */
|
of the function here. */
|
||||||
|
|
||||||
const UChar* ptr = (const UChar*)pattern;
|
|
||||||
const UChar* patternEnd = pattern + patternLength;
|
const UChar* patternEnd = pattern + patternLength;
|
||||||
unsigned char* code = const_cast<unsigned char*>(codeStart);
|
unsigned char* code = const_cast<unsigned char*>(codeStart);
|
||||||
int firstByte, reqByte;
|
int firstByte, reqByte;
|
||||||
int bracketCount = 0;
|
int bracketCount = 0;
|
||||||
if (!cd.needOuterBracket)
|
if (!cd.needOuterBracket)
|
||||||
compileBranch(re->options, &bracketCount, &code, &ptr, patternEnd, &errorcode, &firstByte, &reqByte, cd);
|
compileBranch(re->options, &bracketCount, &code, &pattern, patternEnd, &errorcode, &firstByte, &reqByte, cd);
|
||||||
else {
|
else {
|
||||||
*code = OP_BRA;
|
*code = OP_BRA;
|
||||||
compileBracket(re->options, &bracketCount, &code, &ptr, patternEnd, &errorcode, 0, &firstByte, &reqByte, cd);
|
compileBracket(re->options, &bracketCount, &code, &pattern, patternEnd, &errorcode, 0, &firstByte, &reqByte, cd);
|
||||||
}
|
}
|
||||||
re->topBracket = bracketCount;
|
re->topBracket = bracketCount;
|
||||||
re->topBackref = cd.topBackref;
|
re->topBackref = cd.topBackref;
|
||||||
|
|
||||||
/* If not reached end of pattern on success, there's an excess bracket. */
|
/* If not reached end of pattern on success, there's an excess bracket. */
|
||||||
|
|
||||||
if (errorcode == 0 && ptr < patternEnd)
|
if (errorcode == 0 && pattern < patternEnd)
|
||||||
errorcode = ERR10;
|
errorcode = ERR10;
|
||||||
|
|
||||||
/* Fill in the terminating state and check for disastrous overflow, but
|
/* Fill in the terminating state and check for disastrous overflow, but
|
||||||
|
|
|
@ -1399,7 +1399,7 @@ void jitCompileRegex(JSGlobalData* globalData, RegexCodeBlock& jitObject, const
|
||||||
if (generator.generationFailed()) {
|
if (generator.generationFailed()) {
|
||||||
JSRegExpIgnoreCaseOption ignoreCaseOption = ignoreCase ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase;
|
JSRegExpIgnoreCaseOption ignoreCaseOption = ignoreCase ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase;
|
||||||
JSRegExpMultilineOption multilineOption = multiline ? JSRegExpMultiline : JSRegExpSingleLine;
|
JSRegExpMultilineOption multilineOption = multiline ? JSRegExpMultiline : JSRegExpSingleLine;
|
||||||
jitObject.setFallback(jsRegExpCompile(reinterpret_cast<const UChar*>(patternString.data()), patternString.size(), ignoreCaseOption, multilineOption, &numSubpatterns, &error));
|
jitObject.setFallback(jsRegExpCompile(patternString.data(), patternString.size(), ignoreCaseOption, multilineOption, &numSubpatterns, &error));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue