@@ -334,7 +334,7 @@ bool MenuItemAtlasFont::initWithString(const std::string& value, const std::stri
334
334
335
335
bool MenuItemAtlasFont::initWithString (const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, const ccMenuCallback& callback)
336
336
{
337
- CCASSERT ( value.size () != 0 , " value length must be greater than 0" );
337
+ CCASSERT ( ! value.empty () , " value length must be greater than 0" );
338
338
LabelAtlas *label = LabelAtlas::create ();
339
339
label->initWithString (value, charMapFile, itemWidth, itemHeight, startCharMap);
340
340
if (MenuItemLabel::initWithLabel (label, callback))
@@ -736,17 +736,17 @@ bool MenuItemImage::initWithNormalImage(const std::string& normalImage, const st
736
736
Node *selectedSprite = nullptr ;
737
737
Node *disabledSprite = nullptr ;
738
738
739
- if (normalImage.size () > 0 )
739
+ if (! normalImage.empty () )
740
740
{
741
741
normalSprite = Sprite::create (normalImage);
742
742
}
743
743
744
- if (selectedImage.size () > 0 )
744
+ if (! selectedImage.empty () )
745
745
{
746
746
selectedSprite = Sprite::create (selectedImage);
747
747
}
748
748
749
- if (disabledImage.size () > 0 )
749
+ if (! disabledImage.empty () )
750
750
{
751
751
disabledSprite = Sprite::create (disabledImage);
752
752
}
@@ -952,7 +952,7 @@ void MenuItemToggle::cleanup()
952
952
953
953
void MenuItemToggle::setSelectedIndex (unsigned int index)
954
954
{
955
- if ( index != _selectedIndex && _subItems.size () > 0 )
955
+ if ( index != _selectedIndex && ! _subItems.empty () )
956
956
{
957
957
_selectedIndex = index;
958
958
if (_selectedItem)
0 commit comments