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
diff --git a/modules/input/evdev/InputDeviceManager.h b/modules/input/evdev/InputDeviceManager.h
index b652155..2c0ffc8 100644
--- a/modules/input/evdev/InputDeviceManager.h
+++ b/modules/input/evdev/InputDeviceManager.h
@@ -36,10 +36,10 @@
public:
virtual ~InputDeviceManager() override = default;
- virtual void onInputEvent(std::shared_ptr<InputDeviceNode> node, InputEvent& event,
+ virtual void onInputEvent(const std::shared_ptr<InputDeviceNode>& node, InputEvent& event,
nsecs_t event_time) override;
- virtual void onDeviceAdded(std::shared_ptr<InputDeviceNode> node) override;
- virtual void onDeviceRemoved(std::shared_ptr<InputDeviceNode> node) override;
+ virtual void onDeviceAdded(const std::shared_ptr<InputDeviceNode>& node) override;
+ virtual void onDeviceRemoved(const std::shared_ptr<InputDeviceNode>& node) override;
private:
template<class T, class U>