Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2cd159d

Browse files
committed
Address comments
1 parent e72a99a commit 2cd159d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎compiler/rustc_query_system/src/dep_graph/serialized.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ impl SerializedDepGraph {
204204
.map(|&n| UnhashMap::with_capacity_and_hasher(n, Default::default()))
205205
.collect();
206206

207+
// Use a single loop to build indices for all kinds, unlike `setup_index` which builds
208+
// a single index for each loop over the nodes.
207209
for (idx, node) in self.nodes.iter_enumerated() {
208210
index[node.kind.as_usize()].insert(node.hash, idx);
209211
}
@@ -220,7 +222,9 @@ impl SerializedDepGraph {
220222
let client = jobserver::client();
221223
// This should ideally use `try_acquire` to avoid races on the tokens,
222224
// but the jobserver crate doesn't support that operation.
223-
if let Ok(true) = client.available().map(|tokens| tokens > 0) {
225+
if let Ok(tokens) = client.available()
226+
&& tokens > 0
227+
{
224228
let this = self.clone();
225229
thread::spawn(move || {
226230
let _token = client.acquire();

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /