Auto merge of #85154 - cjgillot:lessfn, r=bjorn3
Reduce amount of function pointers in query invocation. r? `@ghost`
This commit is contained in:
@@ -353,14 +353,14 @@ macro_rules! define_queries {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn compute(tcx: QueryCtxt<'tcx>, key: Self::Key) -> Self::Value {
|
||||
let is_local = key.query_crate() == LOCAL_CRATE;
|
||||
let provider = if is_local {
|
||||
fn compute_fn(tcx: QueryCtxt<'tcx>, key: &Self::Key) ->
|
||||
fn(TyCtxt<'tcx>, Self::Key) -> Self::Value
|
||||
{
|
||||
if key.query_crate_is_local() {
|
||||
tcx.queries.local_providers.$name
|
||||
} else {
|
||||
tcx.queries.extern_providers.$name
|
||||
};
|
||||
provider(*tcx, key)
|
||||
}
|
||||
}
|
||||
|
||||
fn hash_result(
|
||||
|
||||
Reference in New Issue
Block a user