libcamera: V4L2BufferCache: Use the entry reference

Instead of looking up the index in the storage vector use the reference
to it created at the beginning of the loop.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Niklas Söderlund
2020-03-04 23:57:56 +01:00
parent 353851b773
commit bab5749227
+1 -1
View File
@@ -216,7 +216,7 @@ int V4L2BufferCache::get(const FrameBuffer &buffer)
use = index;
/* Try to find a cache hit by comparing the planes. */
if (cache_[index] == buffer) {
if (entry == buffer) {
hit = true;
use = index;
break;