diff options
| author | LemonBoy <thatlemon@gmail.com> | 2020-02-15 21:33:59 +0100 |
|---|---|---|
| committer | LemonBoy <thatlemon@gmail.com> | 2020-02-16 19:53:53 +0100 |
| commit | 59a243ce24e858260d289c5c40f3430223b7d98b (patch) | |
| tree | 14af6f6b38caca591ff8d1fa76330137b3c4b327 /lib/std | |
| parent | 096f79260b025ab53d77c4943f237676abb5b7d8 (diff) | |
| download | zig-59a243ce24e858260d289c5c40f3430223b7d98b.tar.gz zig-59a243ce24e858260d289c5c40f3430223b7d98b.zip | |
std: Remove now-superflous hack
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/json.zig | 4 | ||||
| -rw-r--r-- | lib/std/zig/tokenizer.zig | 8 |
2 files changed, 3 insertions, 9 deletions
diff --git a/lib/std/json.zig b/lib/std/json.zig index 74e008d76e..b04861eaae 100644 --- a/lib/std/json.zig +++ b/lib/std/json.zig @@ -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; diff --git a/lib/std/zig/tokenizer.zig b/lib/std/zig/tokenizer.zig index 327700f591..f6c71479e7 100644 --- a/lib/std/zig/tokenizer.zig +++ b/lib/std/zig/tokenizer.zig @@ -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; } } |
