Commit 5713ca49 authored by Vaclav Brozek's avatar Vaclav Brozek Committed by Commit Bot

Use "auto" in ArcAppResult::Duplicate()

One of the use-cases of auto is to remove duplicated type information:
  std::unique_ptr<X> x = std::make_unique<X>(...);
then becomes just
  auto x = std::make_unique<X>(...);
The benefit is code which is easier to read, without losing any
information about the type.

This CL is a follow-up after https://crrev.com/c/998194, which
introduced a line
  std::unique_ptr<ArcAppResult> copy = std::make_unique<ArcAppResult>(
That line is being shortened using auto.

Bug: 733662
Change-Id: I694330c283a453b5d2020c8ec237fafdf6572f20
Reviewed-on: https://chromium-review.googlesource.com/1011604Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550681}
parent 87c264cc
...@@ -59,7 +59,7 @@ void ArcAppResult::Open(int event_flags) { ...@@ -59,7 +59,7 @@ void ArcAppResult::Open(int event_flags) {
} }
std::unique_ptr<ChromeSearchResult> ArcAppResult::Duplicate() const { std::unique_ptr<ChromeSearchResult> ArcAppResult::Duplicate() const {
std::unique_ptr<ArcAppResult> copy = std::make_unique<ArcAppResult>( auto copy = std::make_unique<ArcAppResult>(
profile(), app_id(), controller(), profile(), app_id(), controller(),
display_type() == ash::SearchResultDisplayType::kRecommendation); display_type() == ash::SearchResultDisplayType::kRecommendation);
copy->set_title(title()); copy->set_title(title());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment