Menu

#45 Prefer pass by reference instead of by value

closed-fixed
nobody
None
5
2012-11-10
2012-11-10
logzero
No

Patch fixes pass by value cases spotted by cppcheck tool.

Discussion

  • logzero

    logzero - 2012-11-10

    patch

     
  • Klauss++

    Klauss++ - 2012-11-10

    You can't say

    const std::string &blah = ""

    That's troublesome, it has to either be explicitly cast to a string, or better yet, be a reference to a "std::string emptystring" somewhere

    It's also not worth passing small objects by reference. Like in the collide hash table, T usually is a pointer.

    I'm applying all except those.

     
  • Klauss++

    Klauss++ - 2012-11-10
    • status: open --> closed-fixed
     

Log in to post a comment.