modules: camera: simplify metadata list traversal
keep traveling pointer local to the walking loop
Change-Id: I0038007d6e7a45e519b9b2162c674132477879cc
diff --git a/modules/camera/Metadata.cpp b/modules/camera/Metadata.cpp
index b26986d..d5854f9 100644
--- a/modules/camera/Metadata.cpp
+++ b/modules/camera/Metadata.cpp
@@ -167,8 +167,6 @@
camera_metadata_t* Metadata::generate()
{
- Entry *current;
-
pthread_mutex_lock(&mMutex);
// Reuse if old generated metadata still valid
if (!mDirty && mGenerated != NULL) {
@@ -191,7 +189,7 @@
goto out;
}
// Walk list of entries adding each one to newly allocated metadata
- for (current = mHead; current != NULL; current = current->mNext) {
+ for (Entry *current = mHead; current != NULL; current = current->mNext) {
int res = add_camera_metadata_entry(mGenerated, current->mTag,
current->mData, current->mCount);
if (res != 0) {