diff options
author | azazel <none@none> | 2010-12-11 20:37:38 +0600 |
---|---|---|
committer | azazel <none@none> | 2010-12-11 20:37:38 +0600 |
commit | d2d62eab50fc03bdba66676e508354521e385631 (patch) | |
tree | f4278268481ec42649142a4027aaacae0ee5ee9e /src/server/shared/Database/MySQLConnection.cpp | |
parent | 81db111ffd70338de973fa8b1969367d8ca9624e (diff) |
Cleanup: implemented helper methods for manipulating percentage calculation and used it where appropriate (plus fixed some other warnings).
NOTE: Initially I just wanted to fix some warnings, but noticed that there is no common method for percentage calculation and various formulas are used many time in the code making it difficult to read and understand what the code actually does. So, I introduced several template methods for calculating percent values and adding those values to the original base. I replaced all the raw calculations throughout the code where found, but I could have missed something or could have made a mistake. So, please report any strange behaviour after this commit.
If you ask me why I did it: for the sake of consistency and exact understanding what code means. If you see CalculatePct method, you clearly understand, that it find the value of x percent of y. And you can easily express, for example, spell behviour "reduces smth by x%" by the means of a method instead of recalling school maths.
--HG--
branch : trunk
Diffstat (limited to 'src/server/shared/Database/MySQLConnection.cpp')
0 files changed, 0 insertions, 0 deletions