diff options
author | Alex Ray <aray@google.com> | 2013-07-09 12:19:49 -0700 |
---|---|---|
committer | Alex Ray <aray@google.com> | 2013-07-09 12:59:42 -0700 |
commit | 9cd49c9c4e4fcb3f1fad4c86b60b0e929a5dce9a (patch) | |
tree | 573b857e2fe585507e9d2db3f904a4662f98c52e /modules | |
parent | 764e442baf0b53284a986b7ed91578fdab42142f (diff) | |
download | hardware_libhardware-9cd49c9c4e4fcb3f1fad4c86b60b0e929a5dce9a.zip hardware_libhardware-9cd49c9c4e4fcb3f1fad4c86b60b0e929a5dce9a.tar.gz hardware_libhardware-9cd49c9c4e4fcb3f1fad4c86b60b0e929a5dce9a.tar.bz2 |
modules: camera: simplify metadata list traversal
keep traveling pointer local to the walking loop
Change-Id: I0038007d6e7a45e519b9b2162c674132477879cc
Diffstat (limited to 'modules')
-rw-r--r-- | modules/camera/Metadata.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
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) { |