about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2019-10-18 13:48:18 -0700
committerGitHub <noreply@github.com>2019-10-18 13:48:18 -0700
commitf5f5c9e9939232f5a437c026a7d46fde9da0c02d (patch)
tree265b0bfdc5a48324f4b8af70e0e32180c7c45dbc /src/rustllvm/RustWrapper.cpp
parent8f8a23f6422e78d1a30b40cb623e0b7b690218e9 (diff)
parente4ec4a6da350ae2564971ae826a1bc3ec9a41988 (diff)
downloadrust-f5f5c9e9939232f5a437c026a7d46fde9da0c02d.tar.gz
rust-f5f5c9e9939232f5a437c026a7d46fde9da0c02d.zip
Rollup merge of #65455 - nnethercote:avoid-unnecessary-TokenTree-to-TokenStream-conversions, r=petrochenkov
Avoid unnecessary `TokenTree` to `TokenStream` conversions

A `TokenStream` contains any number of `TokenTrees`. Therefore, a single `TokenTree` can be promoted to a `TokenStream`. But doing so costs two allocations: one for the single-element `Vec`, and one for the `Lrc`. (An `IsJoint` value also must be added; the default is `NonJoint`.)

The current code converts `TokenTree`s to `TokenStream`s unnecessarily in a few places. This PR removes some of these unnecessary conversions, both simplifying the code and speeding it up.

r? @petrochenkov
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions