summaryrefslogtreecommitdiff
path: root/src/guichan/font.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-07-01 12:23:02 +0300
committerAndrei Karas <akaras@inbox.ru>2013-07-01 12:23:02 +0300
commit1bf7aa922ded964035f85444b42c8f8aa4668e92 (patch)
tree73aa477c4b2e576b30b4a8c6102557692c92cdb2 /src/guichan/font.cpp
parentf8871c5bd2131b9fb9ee54575767b8262394ac06 (diff)
downloadmv-1bf7aa922ded964035f85444b42c8f8aa4668e92.tar.gz
mv-1bf7aa922ded964035f85444b42c8f8aa4668e92.tar.bz2
mv-1bf7aa922ded964035f85444b42c8f8aa4668e92.tar.xz
mv-1bf7aa922ded964035f85444b42c8f8aa4668e92.zip
improve size() usage in font.
Diffstat (limited to 'src/guichan/font.cpp')
-rw-r--r--src/guichan/font.cpp6
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