#500 Various small fixes

Next_major_release
closed
nobody
None
6
2013-07-10
2013-07-07
Andreas Jonsson
No

Some small fixes. Pay extra attention to the one for TreeView.cpp. TVS_HASBUTTONS is "OR:ed" twice, not sure if one of them should be something else.

1 Attachments

Discussion

  • Don HO
    Don HO
    2013-07-07

    Thank you Andreas.
    Regarding the post increment and post increment and pre increment,
    may I know the reason you prefer pre increment than post one?

    Don

     
    Last edit: Don HO 2013-07-07
  • Neomi
    Neomi
    2013-07-07

    While I'm not Andreas, I can answer that.
    A post-increment returns the contents before incrementing an iterator/variable, therefore it needs to make a copy first. A pre-increment doesn't make a copy, it just increments and returns the new contents. Any decent compiler optimizes the copy out if it isn't needed and optimizations are enabled, so it doesn't really make a difference here. But it is still considered "good practice" to use pre-increment where possible since there are still some old or bad compilers out there and there are unoptimized debug builds.

     
  • Yes, precisely. Obviously won't make much of a difference even if it wasn't optimized away, but still my preference.

     
  • Don HO
    Don HO
    2013-07-07

    OK, thank you both for your answers. I'll adapt this preference.

    Don

     
    Last edit: Don HO 2013-07-07
  • Don HO
    Don HO
    2013-07-07

    • status: open --> accepted
    • Priority: 5 --> 6
     
  • Don HO
    Don HO
    2013-07-10

    • status: accepted --> closed