Skip to content

Commit

Permalink
src: make minor performance improvement
Browse files Browse the repository at this point in the history
The call to uv_handle_get_loop() is not inlined, and adds a callq
instruction to simply return a pointer. Instead return the pointer
directly and save an instruction.
  • Loading branch information
trevnorris committed Oct 6, 2023
1 parent 35b157c commit fc47436
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/nsuv-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ uv_handle_t* ns_handle<UV_T, H_T>::base_handle() {

template <class UV_T, class H_T>
uv_loop_t* ns_handle<UV_T, H_T>::get_loop() {
return uv_handle_get_loop(base_handle());
return base_handle()->loop;
}

template <class UV_T, class H_T>
Expand Down

0 comments on commit fc47436

Please sign in to comment.