std: Remove now-superflous hack

This commit is contained in:
LemonBoy 2020-02-15 21:33:59 +01:00
parent 096f79260b
commit 59a243ce24
2 changed files with 3 additions and 9 deletions

View File

@ -1026,10 +1026,8 @@ pub const TokenStream = struct {
pub fn next(self: *TokenStream) Error!?Token {
if (self.token) |token| {
// TODO: Audit this pattern once #2915 is closed
const copy = token;
self.token = null;
return copy;
return token;
}
var t1: ?Token = undefined;

View File

@ -414,10 +414,8 @@ pub const Tokenizer = struct {
pub fn next(self: *Tokenizer) Token {
if (self.pending_invalid_token) |token| {
// TODO: Audit this pattern once #2915 is closed
const copy = token;
self.pending_invalid_token = null;
return copy;
return token;
}
const start_index = self.index;
var state = State.Start;
@ -1270,10 +1268,8 @@ pub const Tokenizer = struct {
if (result.id == Token.Id.Eof) {
if (self.pending_invalid_token) |token| {
// TODO: Audit this pattern once #2915 is closed
const copy = token;
self.pending_invalid_token = null;
return copy;
return token;
}
}