diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-10-26 05:14:23 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-10-26 05:20:22 +0200 |
commit | 131d11a7c2c1612c940db100003a09c8e10e4d2d (patch) | |
tree | c92f9e0a0d810bddb60989d15cbad43bac710ede /crawl-ref/source/skills.cc | |
parent | 6b76d9282724e7826dd3e732b58ab3c57fcda26c (diff) | |
download | crawl-ref-131d11a7c2c1612c940db100003a09c8e10e4d2d.tar.gz crawl-ref-131d11a7c2c1612c940db100003a09c8e10e4d2d.zip |
Rewrite (x*y)/z as x*y/z
Also, simplify an expression such removal of parentheses revealed.
Diffstat (limited to 'crawl-ref/source/skills.cc')
-rw-r--r-- | crawl-ref/source/skills.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/skills.cc b/crawl-ref/source/skills.cc index 4c5f6bac53..407266e804 100644 --- a/crawl-ref/source/skills.cc +++ b/crawl-ref/source/skills.cc @@ -962,9 +962,9 @@ static int _train(skill_type exsk, int &max_exp, bool simu) const int spending_limit = min(MAX_SPENDING_LIMIT, max_exp); if (cost > spending_limit) { - int frac = (spending_limit * 10) / cost; + int frac = spending_limit * 10 / cost; cost = spending_limit; - skill_inc = (skill_inc * frac) / 10; + skill_inc = skill_inc * frac / 10; } if (skill_inc <= 0) |