diff options
author | Adam Borowski <kilobyte@angband.pl> | 2010-11-04 12:01:41 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2010-11-04 12:01:41 +0100 |
commit | 5463161aea273fe8090bbc5aca200983bfc2f3a6 (patch) | |
tree | 6c4856364b2d0a311c34f45329ed31a245bcffc1 /crawl-ref/source/coordit.cc | |
parent | 9eec9bd08035d1bce8a5278190ee8ef37c50a49a (diff) | |
download | crawl-ref-5463161aea273fe8090bbc5aca200983bfc2f3a6.tar.gz crawl-ref-5463161aea273fe8090bbc5aca200983bfc2f3a6.zip |
Reduce a series of redundant comparisons.
Diffstat (limited to 'crawl-ref/source/coordit.cc')
-rw-r--r-- | crawl-ref/source/coordit.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/crawl-ref/source/coordit.cc b/crawl-ref/source/coordit.cc index ac3cd5adbc..0a43b0f2bf 100644 --- a/crawl-ref/source/coordit.cc +++ b/crawl-ref/source/coordit.cc @@ -249,14 +249,20 @@ again: push_neigh(d, sgn(d.x), 0); if (!d.x) push_neigh(d, 0, sgn(d.y)); - if (d.x <= 0 && d.y <= 0) - push_neigh(d, -1, -1); - if (d.x >= 0 && d.y <= 0) - push_neigh(d, +1, -1); - if (d.x <= 0 && d.y >= 0) - push_neigh(d, -1, +1); - if (d.x >= 0 && d.y >= 0) - push_neigh(d, +1, +1); + if (d.x <= 0) + { + if (d.y <= 0) + push_neigh(d, -1, -1); + if (d.y >= 0) + push_neigh(d, -1, +1); + } + if (d.x >= 0) + { + if (d.y <= 0) + push_neigh(d, +1, -1); + if (d.y >= 0) + push_neigh(d, +1, +1); + } return true; } |