diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-07-01 12:23:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-07-01 12:23:02 +0300 |
commit | 1bf7aa922ded964035f85444b42c8f8aa4668e92 (patch) | |
tree | 73aa477c4b2e576b30b4a8c6102557692c92cdb2 /src/guichan/font.cpp | |
parent | f8871c5bd2131b9fb9ee54575767b8262394ac06 (diff) | |
download | manaverse-1bf7aa922ded964035f85444b42c8f8aa4668e92.tar.gz manaverse-1bf7aa922ded964035f85444b42c8f8aa4668e92.tar.bz2 manaverse-1bf7aa922ded964035f85444b42c8f8aa4668e92.tar.xz manaverse-1bf7aa922ded964035f85444b42c8f8aa4668e92.zip |
improve size() usage in font.
Diffstat (limited to 'src/guichan/font.cpp')
-rw-r--r-- | src/guichan/font.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/guichan/font.cpp b/src/guichan/font.cpp index e04ce0e83..32968bc84 100644 --- a/src/guichan/font.cpp +++ b/src/guichan/font.cpp @@ -56,13 +56,13 @@ namespace gcn { int Font::getStringIndexAt(const std::string& text, const int x) const { - for (unsigned int i = 0, sz = static_cast<unsigned int>(text.size()); - i < sz; ++i) + const size_t sz = text.size(); + for (size_t i = 0; i < sz; ++i) { if (getWidth(text.substr(0, i)) > x) return i; } - return static_cast<int>(text.size()); + return static_cast<int>(sz); } } // namespace gcn |