Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2452)

Unified Diff: device/bluetooth/bluetooth_uuid.cc

Issue 2127373006: Use base::StartWith() in more places when appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_uuid.cc
diff --git a/device/bluetooth/bluetooth_uuid.cc b/device/bluetooth/bluetooth_uuid.cc
index 071493a902b55ac8b0570b190e2ecf1885b1fa0d..b35094deba169ab202a92d118bb5d02027b38c18 100644
--- a/device/bluetooth/bluetooth_uuid.cc
+++ b/device/bluetooth/bluetooth_uuid.cc
@@ -13,8 +13,8 @@ namespace device {
namespace {
-const char* kCommonUuidPostfix = "-0000-1000-8000-00805f9b34fb";
-const char* kCommonUuidPrefix = "0000";
+const char kCommonUuidPostfix[] = "-0000-1000-8000-00805f9b34fb";
+const char kCommonUuidPrefix[] = "0000";
// Returns the canonical, 128-bit canonical, and the format of the UUID
// in |canonical|, |canonical_128|, and |format| based on |uuid|.
@@ -30,8 +30,10 @@ void GetCanonicalUuid(std::string uuid,
if (uuid.empty())
return;
- if (uuid.size() < 11 && uuid.find("0x") == 0)
+ if (uuid.size() < 11 &&
+ base::StartsWith(uuid, "0x", base::CompareCase::SENSITIVE)) {
uuid = uuid.substr(2);
+ }
if (!(uuid.size() == 4 || uuid.size() == 8 || uuid.size() == 36))
return;

Powered by Google App Engine
This is Rietveld 408576698