From a9d1aaa774b9e986b8ee3c6cb1e7baa1d9ba3ea5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 9 Aug 2013 23:41:59 +0300 Subject: improve size() methods usage. --- src/guichan/widgets/textfield.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/guichan/widgets/textfield.cpp') 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(text.size()); - + const size_t sz = text.size(); + if (sz < mCaretPosition) + mCaretPosition = sz; mText = text; } -- cgit v1.2.3-60-g2f50