Merge "Fix clang-tidy performance warnings in libhardware."

This commit is contained in:
Chih-hung Hsieh 2016-08-04 21:51:11 +00:00 committed by Gerrit Code Review
commit 1c1e311e06
4 changed files with 8 additions and 8 deletions

View file

@ -334,7 +334,7 @@ public:
int height,
const sp<CameraDeviceBase>& device,
CameraStreamParams param = DEFAULT_STREAM_PARAMETERS,
sp<Surface> surface = NULL,
const sp<Surface>& surface = NULL,
bool useCpuConsumer = true) {
param.mFormat = MapAutoFormat(param.mFormat);
return new CameraStream(width, height, device,

View file

@ -176,7 +176,7 @@ status_t MetadataQueue::setStreamSlot(const List<camera_metadata_t*> &bufs) {
}
status_t MetadataQueue::freeBuffers(List<camera_metadata_t*>::iterator start,
List<camera_metadata_t*>::iterator end) {
const List<camera_metadata_t*>::iterator& end) {
while (start != end) {
free_camera_metadata(*start);
start = mStreamSlot.erase(start);

View file

@ -65,7 +65,7 @@ class MetadataQueue: public camera2_request_queue_src_ops_t,
private:
status_t freeBuffers(List<camera_metadata_t*>::iterator start,
List<camera_metadata_t*>::iterator end);
const List<camera_metadata_t*>::iterator& end);
camera2_device_t *mDevice;

View file

@ -44,8 +44,8 @@ using namespace std::literals::chrono_literals;
using InputCbFunc = std::function<void(std::shared_ptr<InputDeviceNode>, InputEvent&, nsecs_t)>;
using DeviceCbFunc = std::function<void(std::shared_ptr<InputDeviceNode>)>;
static const InputCbFunc kNoopInputCb = [](std::shared_ptr<InputDeviceNode>, InputEvent&, nsecs_t){};
static const DeviceCbFunc kNoopDeviceCb = [](std::shared_ptr<InputDeviceNode>){};
static const InputCbFunc kNoopInputCb = [](const std::shared_ptr<InputDeviceNode>&, InputEvent&, nsecs_t){};
static const DeviceCbFunc kNoopDeviceCb = [](const std::shared_ptr<InputDeviceNode>&){};
class TestInputCallback : public InputCallbackInterface {
public:
@ -53,9 +53,9 @@ public:
mInputCb(kNoopInputCb), mDeviceAddedCb(kNoopDeviceCb), mDeviceRemovedCb(kNoopDeviceCb) {}
virtual ~TestInputCallback() = default;
void setInputCallback(InputCbFunc cb) { mInputCb = cb; }
void setDeviceAddedCallback(DeviceCbFunc cb) { mDeviceAddedCb = cb; }
void setDeviceRemovedCallback(DeviceCbFunc cb) { mDeviceRemovedCb = cb; }
void setInputCallback(const InputCbFunc& cb) { mInputCb = cb; }
void setDeviceAddedCallback(const DeviceCbFunc& cb) { mDeviceAddedCb = cb; }
void setDeviceRemovedCallback(const DeviceCbFunc& cb) { mDeviceRemovedCb = cb; }
virtual void onInputEvent(std::shared_ptr<InputDeviceNode> node, InputEvent& event,
nsecs_t event_time) override {