mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 849367 (part 1) - Speed up TokenStream::matchChar(). r=jorendorff.
--HG-- extra : rebase_source : 1527af5e38158a69f74d252320a899d9208055c6
This commit is contained in:
parent
c8cee2f373
commit
a6acef8a0c
@ -805,12 +805,11 @@ class TokenStream
|
||||
bool peekChars(int n, jschar *cp);
|
||||
bool getAtSourceMappingURL(bool isMultiline);
|
||||
|
||||
// |expect| cannot be an EOL char.
|
||||
bool matchChar(int32_t expect) {
|
||||
int32_t c = getChar();
|
||||
if (c == expect)
|
||||
return true;
|
||||
ungetChar(c);
|
||||
return false;
|
||||
MOZ_ASSERT(!TokenBuf::isRawEOLChar(expect));
|
||||
return JS_LIKELY(userbuf.hasRawChars()) &&
|
||||
userbuf.matchRawChar(expect);
|
||||
}
|
||||
|
||||
void consumeKnownChar(int32_t expect) {
|
||||
|
Loading…
Reference in New Issue
Block a user