Skip to content

Commit

Permalink
Avoiding creation of new string for component version.
Browse files Browse the repository at this point in the history
base::Version constructor already takes a std::string, so no need to
pass in result of c_str() which would just create a second std::string.

Review URL: https://codereview.chromium.org/1280673002

Cr-Commit-Position: refs/heads/master@{#342383}
  • Loading branch information
cmumford authored and Commit bot committed Aug 7, 2015
1 parent a69cf2d commit c7a9315
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ bool DefaultComponentInstaller::Install(const base::DictionaryValue& manifest,
const base::FilePath& unpack_path) {
std::string manifest_version;
manifest.GetStringASCII("version", &manifest_version);
base::Version version(manifest_version.c_str());
base::Version version(manifest_version);
if (!version.IsValid())
return false;
if (current_version_.CompareTo(version) > 0)
Expand Down

0 comments on commit c7a9315

Please sign in to comment.