зеркало из https://github.com/mozilla/gecko-dev.git
Bug 673188 style followup.
This commit is contained in:
Родитель
838539811c
Коммит
caa8880c43
|
@ -529,7 +529,7 @@ ExecuteRegExp(JSContext *cx, Native native, uintN argc, Value *vp)
|
|||
RegExpStatics *res = cx->regExpStatics();
|
||||
|
||||
/* Step 2. */
|
||||
JSString *input = js_ValueToString(cx, args.length() > 0 ? args[0] : UndefinedValue());
|
||||
JSString *input = js_ValueToString(cx, (args.length() > 0) ? args[0] : UndefinedValue());
|
||||
if (!input)
|
||||
return false;
|
||||
|
||||
|
@ -558,7 +558,7 @@ ExecuteRegExp(JSContext *cx, Native native, uintN argc, Value *vp)
|
|||
}
|
||||
|
||||
/* Steps 8-21. */
|
||||
RegExpExecType execType = native == regexp_test ? RegExpTest : RegExpExec;
|
||||
RegExpExecType execType = (native == regexp_test) ? RegExpTest : RegExpExec;
|
||||
size_t lastIndexInt(i);
|
||||
if (!ExecuteRegExp(cx, res, rep, linearInput, chars, length, &lastIndexInt, execType,
|
||||
&args.rval())) {
|
||||
|
|
|
@ -1449,7 +1449,7 @@ class RegExpGuard
|
|||
static JS_ALWAYS_INLINE bool
|
||||
Matched(RegExpExecType type, const Value &v)
|
||||
{
|
||||
return type == RegExpTest ? v.isTrue() : !v.isNull();
|
||||
return (type == RegExpTest) ? v.isTrue() : !v.isNull();
|
||||
}
|
||||
|
||||
typedef bool (*DoMatchCallback)(JSContext *cx, RegExpStatics *res, size_t count, void *data);
|
||||
|
@ -1482,7 +1482,7 @@ DoMatch(JSContext *cx, RegExpStatics *res, JSString *str, const RegExpPair ®E
|
|||
|
||||
if (rep->global()) {
|
||||
/* global matching ('g') */
|
||||
RegExpExecType type = flags & TEST_GLOBAL_BIT ? RegExpTest : RegExpExec;
|
||||
RegExpExecType type = (flags & TEST_GLOBAL_BIT) ? RegExpTest : RegExpExec;
|
||||
if (RegExpObject *reobj = regExpPair.reobj())
|
||||
reobj->zeroLastIndex();
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ class MatchPairs
|
|||
return;
|
||||
|
||||
for (int *it = buffer_; it < buffer_ + 2 * pairCount_; ++it)
|
||||
*it = *it < 0 ? -1 : *it + amount;
|
||||
*it = (*it < 0) ? -1 : *it + amount;
|
||||
}
|
||||
|
||||
inline void checkAgainst(size_t length);
|
||||
|
|
Загрузка…
Ссылка в новой задаче