summaryrefslogtreecommitdiff
path: root/src/guichan/widgets/textfield.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-09 23:41:59 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-09 23:41:59 +0300
commita9d1aaa774b9e986b8ee3c6cb1e7baa1d9ba3ea5 (patch)
tree20a5024ce03d3b0abedd76378c534f4150af0ee9 /src/guichan/widgets/textfield.cpp
parentd0ccffd7db79f5dbff6f2cb4f8b77a8bb3435e57 (diff)
downloadplus-a9d1aaa774b9e986b8ee3c6cb1e7baa1d9ba3ea5.tar.gz
plus-a9d1aaa774b9e986b8ee3c6cb1e7baa1d9ba3ea5.tar.bz2
plus-a9d1aaa774b9e986b8ee3c6cb1e7baa1d9ba3ea5.tar.xz
plus-a9d1aaa774b9e986b8ee3c6cb1e7baa1d9ba3ea5.zip
improve size() methods usage.
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;
}