Changes between Initial Version and Version 1 of Ticket #1923, comment 35


Ignore:
Timestamp:
Jun 30, 2013, 5:50:11 PM (11 years ago)
Author:
Jorma Rebane

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1923, comment 35

    initial v1  
    44
    55I know that there is a lot to improve in 0 A.D. source and it's hard not to fix everything :) But try to focus on a single task per ticket.
     6
     7In general about the patches though:
     8* I think "const size_t value;" and "int getStuff(const MyStuff& arg) const" is all right, but "const size_t* const pvalue;" is a bit pushing the limits of readability :). Furthermore it should give no performance boost, since it's just a compile time check to make the variable read-only. The assembly generated has no difference. So having "int getStuff(const size_t arg)" is totally unnecessary, however "void doStuff(const MyStuff& arg)" still makes sense - since you are guaranteeing the value passed by reference will not change.
     9
     10* Storing calculations in temporary variables is common sense and good practice in general, so that's the correct way to go.
     11* Passing larger than 4-byte values by reference is also a good thing to do. In general 0 A.D. has too many copy-on-move and temporary objects, so it's important to reduce that.
     12
     13If you have created new tickets to categorize the patches and have removed the old patches, I can give you a better review than this. :)