From 9cd49c9c4e4fcb3f1fad4c86b60b0e929a5dce9a Mon Sep 17 00:00:00 2001 From: Alex Ray Date: Tue, 9 Jul 2013 12:19:49 -0700 Subject: modules: camera: simplify metadata list traversal keep traveling pointer local to the walking loop Change-Id: I0038007d6e7a45e519b9b2162c674132477879cc --- modules/camera/Metadata.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'modules/camera/Metadata.cpp') 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 @@ int Metadata::add(uint32_t tag, int count, void *tag_data) 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 @@ camera_metadata_t* Metadata::generate() 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) { -- cgit v1.1