Skip to content

Commit

Permalink
Use a reference to the interchange data instead of copying it to the …
Browse files Browse the repository at this point in the history
…stack
  • Loading branch information
sosthene-nitrokey committed Jul 20, 2023
1 parent f15a42b commit 1e49931
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ impl<P: Platform, D: Dispatch> Service<P, D> {
let resources = &mut self.resources;

for ep in eps.iter_mut() {
if let Some(request) = ep.interchange.take_request() {
if let Ok(request) = ep.interchange.request() {
resources
.platform
.user_interface()
Expand All @@ -824,12 +824,12 @@ impl<P: Platform, D: Dispatch> Service<P, D> {

// resources.currently_serving = ep.client_id.clone();
let reply_result = if ep.backends.is_empty() {
resources.reply_to(&mut ep.ctx.core, &request)
resources.reply_to(&mut ep.ctx.core, request)
} else {
let mut reply_result = Err(Error::RequestNotAvailable);
for backend in ep.backends {
reply_result =
resources.dispatch(&mut self.dispatch, backend, &mut ep.ctx, &request);
resources.dispatch(&mut self.dispatch, backend, &mut ep.ctx, request);
if reply_result != Err(Error::RequestNotAvailable) {
break;
}
Expand Down

0 comments on commit 1e49931

Please sign in to comment.