libcamera: framebuffer: Replace vector with span in constructor
The FrameBuffer constructor takes a list of planes as an std::vector. The caller may stores the planes in a different type of container, resulting in the needless allocation of a temporary vector. Replace it with a span. Suggested-by: Daniel Rákos <daniel.rakos@rastergrid.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
This commit is contained in:
@@ -29,7 +29,7 @@ class CrosFrameBufferData : public FrameBuffer::Private
|
||||
|
||||
public:
|
||||
CrosFrameBufferData(cros::ScopedBufferHandle scopedHandle,
|
||||
const std::vector<FrameBuffer::Plane> &planes)
|
||||
Span<const FrameBuffer::Plane> planes)
|
||||
: FrameBuffer::Private(planes), scopedHandle_(std::move(scopedHandle))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class GenericFrameBufferData : public FrameBuffer::Private
|
||||
public:
|
||||
GenericFrameBufferData(struct alloc_device_t *allocDevice,
|
||||
buffer_handle_t handle,
|
||||
const std::vector<FrameBuffer::Plane> &planes)
|
||||
Span<const FrameBuffer::Plane> planes)
|
||||
: FrameBuffer::Private(planes), allocDevice_(allocDevice),
|
||||
handle_(handle)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user