diff options
author | Tim Kilbourn <tkilbourn@google.com> | 2015-04-29 13:50:17 -0700 |
---|---|---|
committer | Tim Kilbourn <tkilbourn@google.com> | 2015-04-29 15:33:25 -0700 |
commit | c929d2509530b0262681c8e6619609f44bfceea4 (patch) | |
tree | 8aba768574fd551bde298b6304b16597fe3597c0 /modules/input/evdev/InputDeviceManager.cpp | |
parent | eedee7b8b5339d38ecd203b5b4849f496e352a35 (diff) |
Clarify usage of smart pointers
- Members should be smart (shared or unique)
- Prefer function args to be bare, unless the arg is intended to be
stored by the callee
- Function args that are smart should be const refs to avoid an extra
copy
Change-Id: I8052fa432bcffbabff9d67a8d568640cac64d4ad
Diffstat (limited to 'modules/input/evdev/InputDeviceManager.cpp')
-rw-r--r-- | modules/input/evdev/InputDeviceManager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/input/evdev/InputDeviceManager.cpp b/modules/input/evdev/InputDeviceManager.cpp index ceddd90e..79a9610b 100644 --- a/modules/input/evdev/InputDeviceManager.cpp +++ b/modules/input/evdev/InputDeviceManager.cpp @@ -24,7 +24,7 @@ namespace android { -void InputDeviceManager::onInputEvent(std::shared_ptr<InputDeviceNode> node, InputEvent& event, +void InputDeviceManager::onInputEvent(const std::shared_ptr<InputDeviceNode>& node, InputEvent& event, nsecs_t event_time) { if (mDevices[node] == nullptr) { ALOGE("got input event for unknown node %s", node->getPath().c_str()); @@ -33,11 +33,11 @@ void InputDeviceManager::onInputEvent(std::shared_ptr<InputDeviceNode> node, Inp mDevices[node]->processInput(event, event_time); } -void InputDeviceManager::onDeviceAdded(std::shared_ptr<InputDeviceNode> node) { +void InputDeviceManager::onDeviceAdded(const std::shared_ptr<InputDeviceNode>& node) { mDevices[node] = std::make_shared<EvdevDevice>(node); } -void InputDeviceManager::onDeviceRemoved(std::shared_ptr<InputDeviceNode> node) { +void InputDeviceManager::onDeviceRemoved(const std::shared_ptr<InputDeviceNode>& node) { if (mDevices[node] == nullptr) { ALOGE("could not remove unknown node %s", node->getPath().c_str()); return; |