aboutsummaryrefslogtreecommitdiff
path: root/engines/m4
diff options
context:
space:
mode:
authorMax Horn2008-10-12 22:06:31 +0000
committerMax Horn2008-10-12 22:06:31 +0000
commit19b6289688353541297921252e55e6a5c5bc4076 (patch)
tree549d8728be5a24b2d3cdd7e0a57c32bc524eb356 /engines/m4
parent95474b048aa742f500f276f782e9998eccfce8d9 (diff)
downloadscummvm-rg350-19b6289688353541297921252e55e6a5c5bc4076.tar.gz
scummvm-rg350-19b6289688353541297921252e55e6a5c5bc4076.tar.bz2
scummvm-rg350-19b6289688353541297921252e55e6a5c5bc4076.zip
Don't call Common::List::size() if you don't have to (it's an expensive operation, which has to iterate the whole List, while empty() works in constant time)
svn-id: r34786
Diffstat (limited to 'engines/m4')
-rw-r--r--engines/m4/m4.cpp2
-rw-r--r--engines/m4/viewmgr.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp
index 44d7f653d1..67201c2aff 100644
--- a/engines/m4/m4.cpp
+++ b/engines/m4/m4.cpp
@@ -205,7 +205,7 @@ void M4Engine::eventHandler() {
uint32 keycode = 0;
if ((event = _events->handleEvents()) != MEVENT_NO_EVENT) {
- if (_viewManager->viewCount() > 0)
+ if (_viewManager->containsViews())
_viewManager->handleMouseEvents(event);
}
diff --git a/engines/m4/viewmgr.h b/engines/m4/viewmgr.h
index 148fb565da..d3e7b1622d 100644
--- a/engines/m4/viewmgr.h
+++ b/engines/m4/viewmgr.h
@@ -176,7 +176,7 @@ public:
}
bool contains(int screenType) { return getView(screenType) != NULL; }
View *getView(int screenType);
- int viewCount() { return _views.size(); }
+ int containsViews() { return !_views.empty(); }
void showTextView(const char *textViewName, bool returnToMainMenu = true);
void showAnimView(const char *animViewName, bool returnToMainMenu = true);