summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/random.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2011-07-05 02:18:52 +0200
committerAdam Borowski <kilobyte@angband.pl>2011-07-05 02:23:41 +0200
commit52acb806cc85d5e34a20517b02594c161dad9cdd (patch)
tree853efae5a6e85e539a81721c9795bbee18fd7cac /crawl-ref/source/random.cc
parent3ba445871afb05180862712e32c4c979dc6db786 (diff)
downloadcrawl-ref-52acb806cc85d5e34a20517b02594c161dad9cdd.tar.gz
crawl-ref-52acb806cc85d5e34a20517b02594c161dad9cdd.zip
cppcheck: reduce scope of some variables.
This can improve readability somewhat, and can speed up debug builds.
Diffstat (limited to 'crawl-ref/source/random.cc')
-rw-r--r--crawl-ref/source/random.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/crawl-ref/source/random.cc b/crawl-ref/source/random.cc
index 2a0560ee75..e2f446ea10 100644
--- a/crawl-ref/source/random.cc
+++ b/crawl-ref/source/random.cc
@@ -136,7 +136,6 @@ int maybe_roll_dice(int num, int size, bool random)
int roll_dice(int num, int size)
{
int ret = 0;
- int i;
// If num <= 0 or size <= 0, then we'll just return the default
// value of zero. This is good behaviour in that it will be
@@ -145,7 +144,7 @@ int roll_dice(int num, int size)
{
ret += num; // since random2() is zero based
- for (i = 0; i < num; i++)
+ for (int i = 0; i < num; i++)
ret += random2(size);
}