0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

perf(ext/web): optimize op_cancel_handle (#16318)

Towards #16315
This commit is contained in:
Divy Srivastava 2022-10-17 03:42:05 -07:00 committed by GitHub
parent 2b35cb3f2f
commit 0dc2f02dfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -338,8 +338,8 @@ fn op_encoding_encode_into(
}
/// Creates a [`CancelHandle`] resource that can be used to cancel invocations of certain ops.
#[op]
pub fn op_cancel_handle(state: &mut OpState) -> ResourceId {
#[op(fast)]
pub fn op_cancel_handle(state: &mut OpState) -> u32 {
state.resource_table.add(CancelHandle::new())
}