• iceman's avatar
    Remove redundant c_str() calls. · 4b80ef16
    iceman authored
    It seems, there are lot of redundant calls to std::basic_string<>::c_str() or
    base::StringPiece::c_str() when passing parameters to different functions.
    
    When a result of |string.c_str()| expression is passed to a function that takes
    a StringPiece, it will measure the length of the string using strlen() function.
    This is useless operation because we know the length already.
    
    Even worse, if target function takes a |std::string| then passing c_str() to it
    will lead to copying the string and wasting memory.
    
    No behaviour changes.
    
    BUG=679479
    
    Review-Url: https://codereview.chromium.org/2624583002
    Cr-Commit-Position: refs/heads/master@{#460066}
    4b80ef16
environment.cc 7.16 KB