mirror of
https://github.com/ziglang/zig.git
synced 2026-02-17 14:59:14 +00:00
std: Remove now-superflous hack
This commit is contained in:
parent
096f79260b
commit
59a243ce24
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user