summaryrefslogtreecommitdiff
path: root/src/guichan/widgets/textfield.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/guichan/widgets/textfield.cpp')
-rw-r--r--src/guichan/widgets/textfield.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/guichan/widgets/textfield.cpp b/src/guichan/widgets/textfield.cpp
index e5ecc172b..f0d464995 100644
--- a/src/guichan/widgets/textfield.cpp
+++ b/src/guichan/widgets/textfield.cpp
@@ -89,9 +89,9 @@ namespace gcn
void TextField::setText(const std::string& text)
{
- if (text.size() < mCaretPosition)
- mCaretPosition = static_cast<int>(text.size());
-
+ const size_t sz = text.size();
+ if (sz < mCaretPosition)
+ mCaretPosition = sz;
mText = text;
}