From 1bf7aa922ded964035f85444b42c8f8aa4668e92 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 1 Jul 2013 12:23:02 +0300 Subject: improve size() usage in font. --- src/guichan/font.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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(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(text.size()); + return static_cast(sz); } } // namespace gcn -- cgit v1.2.3-70-g09d2