From 0de43f6ba6aad8275ec5456bcf265fa4abc9aae7 Mon Sep 17 00:00:00 2001 From: knoxHuang <821686174@qq.com> Date: Fri, 9 Dec 2016 14:50:28 +0800 Subject: [PATCH] add const for getListeners --- native/cocos/base/CCEventDispatcher.cpp | 2 +- native/cocos/base/CCEventDispatcher.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/native/cocos/base/CCEventDispatcher.cpp b/native/cocos/base/CCEventDispatcher.cpp index a7b19c6abe..5757843afe 100644 --- a/native/cocos/base/CCEventDispatcher.cpp +++ b/native/cocos/base/CCEventDispatcher.cpp @@ -1291,7 +1291,7 @@ void EventDispatcher::sortEventListenersOfFixedPriority(const EventListener::Lis } -EventDispatcher::EventListenerVector* EventDispatcher::getListeners(const EventListener::ListenerID& listenerID) +EventDispatcher::EventListenerVector* EventDispatcher::getListeners(const EventListener::ListenerID& listenerID) const { auto iter = _listenerMap.find(listenerID); if (iter != _listenerMap.end()) diff --git a/native/cocos/base/CCEventDispatcher.h b/native/cocos/base/CCEventDispatcher.h index 4bc8f6c87f..0925c54abd 100644 --- a/native/cocos/base/CCEventDispatcher.h +++ b/native/cocos/base/CCEventDispatcher.h @@ -249,7 +249,7 @@ protected: void forceAddEventListener(EventListener* listener); /** Gets event the listener list for the event listener type. */ - EventListenerVector* getListeners(const EventListener::ListenerID& listenerID); + EventListenerVector* getListeners(const EventListener::ListenerID& listenerID) const; /** Update dirty flag */ void updateDirtyFlagForSceneGraph();