summaryrefslogtreecommitdiff
path: root/src/guichan/font.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/guichan/font.cpp')
-rw-r--r--src/guichan/font.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/guichan/font.cpp b/src/guichan/font.cpp
index e2485eb0d..598b1610b 100644
--- a/src/guichan/font.cpp
+++ b/src/guichan/font.cpp
@@ -56,14 +56,9 @@ namespace gcn
{
int Font::getStringIndexAt(const std::string& text, int x) const
{
- unsigned int i;
- int size = 0;
-
- for (i = 0; i < text.size(); ++i)
+ for (unsigned int i = 0; i < text.size(); ++i)
{
- size = getWidth(text.substr(0, i));
-
- if (size > x)
+ if (getWidth(text.substr(0, i)) > x)
return i;
}