diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-06-30 22:02:31 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-06-30 22:02:31 +0300 |
commit | 76da58f2272e81fea5b5d05684e8eedd31325447 (patch) | |
tree | 0938864f355856f8a0f1792749161219d3aad38c | |
parent | d7bc7c661a7ed84a20cb9280b79aefa3a3839a83 (diff) | |
download | manaplus-76da58f2272e81fea5b5d05684e8eedd31325447.tar.gz manaplus-76da58f2272e81fea5b5d05684e8eedd31325447.tar.bz2 manaplus-76da58f2272e81fea5b5d05684e8eedd31325447.tar.xz manaplus-76da58f2272e81fea5b5d05684e8eedd31325447.zip |
improve size() usage in map.
-rw-r--r-- | src/map.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/map.cpp b/src/map.cpp index efd108185..aa28a8160 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1377,12 +1377,15 @@ void Map::indexTilesets() mTilesetsIndexed = true; const Tileset *s = nullptr; + size_t sSz = 0; FOR_EACH (Tilesets::const_iterator, it, mTilesets) { - if (!s || s->getFirstGid() + s->size() - < (*it)->getFirstGid() + (*it)->size()) + const size_t sz = (*it)->size(); + if (!s || s->getFirstGid() + sSz + < (*it)->getFirstGid() + sz) { s = *it; + sSz = sz; } } if (!s) |