HidlCache: Minor code readability change
The locked() method returns a bool, so we change the check of it
to a boolean check, instead of an integral comparison.
This should have no behavioral change, as the integral comparison
was equivalent to this boolean one. But the code should be a
little clearer to read.
Test: Treehugger
Change-Id: I05ab025cf4d87e2499f2c96fb265eb207294d61a
diff --git a/libhidlcache/HidlCache.h b/libhidlcache/HidlCache.h
index db778d3..39a7b3a 100644
--- a/libhidlcache/HidlCache.h
+++ b/libhidlcache/HidlCache.h
@@ -97,7 +97,7 @@
template <class Key, class Value, class Compare>
sp<Value> HidlCache<Key, Value, Compare>::unlock(const Key& key) {
Lock lock(mMutex);
- if (locked(key) > 0) {
+ if (locked(key)) {
sp<Value> v = mLocked[key];
mLocked.erase(key);
return v;