Replace Uses of .compare() in Device Files
(This is a merge of http://go/wvgerrit/13390 from the Widevine CDM repository.) Change-Id: I5b3595d5ef52b670e5ba5019746f03d934ae9625
This commit is contained in:
@@ -393,8 +393,7 @@ bool DeviceFiles::DeleteUsageInfo(const std::string& app_id,
|
||||
int index = 0;
|
||||
bool found = false;
|
||||
for (; index < usage_info->sessions_size(); ++index) {
|
||||
if (usage_info->sessions(index).token().compare(provider_session_token) ==
|
||||
0) {
|
||||
if (usage_info->sessions(index).token() == provider_session_token) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
@@ -505,8 +504,7 @@ bool DeviceFiles::RetrieveUsageInfo(const std::string& app_id,
|
||||
int index = 0;
|
||||
bool found = false;
|
||||
for (; index < file.usage_info().sessions_size(); ++index) {
|
||||
if (file.usage_info().sessions(index).token().compare(
|
||||
provider_session_token) == 0) {
|
||||
if (file.usage_info().sessions(index).token() == provider_session_token) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
@@ -667,7 +665,7 @@ bool DeviceFiles::RetrieveHashedFile(const char* name,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (hash.compare(hash_file.hash())) {
|
||||
if (hash != hash_file.hash()) {
|
||||
LOGW("DeviceFiles::RetrieveHashedFile: Hash mismatch");
|
||||
// Remove the corrupted file so the caller will not get the same error
|
||||
// when trying to access the file repeatedly, causing the system to stall.
|
||||
|
||||
Reference in New Issue
Block a user