• Devlin Cronin's avatar
    [Cleanup] Un-const the return of various Extension methods · 15e37b65
    Devlin Cronin authored
    Extension::VersionString(), Extension::DifferentialFingerprint(), and
    Extension::GetVersionForDisplay() returned a `const std::string`;
    there's no reason to do this, since it's a new string (and not a
    reference to a member). Additionally, this could potentially result in
    invocations of these methods creating a copy, if the caller did
    something like:
    
    std::string version_string = extension.VersionString();
    
    Since the result would be a `const std::string`, a copy might be made to
    fit into the non-const std::string required by the caller. Hopefully,
    the compiler is smart enough to optimize this out, but it's better to
    just un-const the result altogether.
    
    Bug: None
    Change-Id: Ic586e8e7f907431ddf5ee3efb7b111b9704c4144
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1919731Reviewed-by: default avatarKelvin Jiang <kelvinjiang@chromium.org>
    Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#716895}
    15e37b65
extension.h 21 KB