Skip to content

Commit

Permalink
Avoid unnecessary copying of vectors in AccessibilityBridge (flutter#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mdempsky authored and chinmaygarde committed May 21, 2019
1 parent 74aaf73 commit ee5915f
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ - (BOOL)onCustomAccessibilityAction:(FlutterCustomAccessibilityAction*)action {
args.push_back(action_id >> 16);
args.push_back(action_id >> 24);
[self bridge] -> DispatchSemanticsAction([self uid], flutter::SemanticsAction::kCustomAction,
args);
std::move(args));
return YES;
}

Expand Down Expand Up @@ -689,14 +689,13 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction {
}

void AccessibilityBridge::DispatchSemanticsAction(int32_t uid, flutter::SemanticsAction action) {
std::vector<uint8_t> args;
platform_view_->DispatchSemanticsAction(uid, action, args);
platform_view_->DispatchSemanticsAction(uid, action, {});
}

void AccessibilityBridge::DispatchSemanticsAction(int32_t uid,
flutter::SemanticsAction action,
std::vector<uint8_t> args) {
platform_view_->DispatchSemanticsAction(uid, action, args);
platform_view_->DispatchSemanticsAction(uid, action, std::move(args));
}

SemanticsObject* AccessibilityBridge::GetOrCreateObject(int32_t uid,
Expand Down

0 comments on commit ee5915f

Please sign in to comment.