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

Unified Diff: components/leveldb/env_mojo.cc

Issue 2121513002: Replace string::find(prefix) == 0 pattern with base::StartsWith(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typos 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: components/leveldb/env_mojo.cc
diff --git a/components/leveldb/env_mojo.cc b/components/leveldb/env_mojo.cc
index 54681d0d1428804689ce71cdd63f973b21cafcd6..233a0cdeee4be4fb55fd7413f692072d9dc8f3b0 100644
--- a/components/leveldb/env_mojo.cc
+++ b/components/leveldb/env_mojo.cc
@@ -8,6 +8,7 @@
#include <memory>
+#include "base/strings/string_util.h"
#include "base/trace_event/trace_event.h"
#include "third_party/leveldatabase/chromium_logger.h"
#include "third_party/leveldatabase/src/include/leveldb/status.h"
@@ -137,10 +138,12 @@ class MojoWritableFile : public leveldb::WritableFile {
dir_(dir),
thread_(thread) {
base::FilePath path = base::FilePath::FromUTF8Unsafe(fname);
- if (path.BaseName().AsUTF8Unsafe().find("MANIFEST") == 0)
+ if (base::StartsWith(path.BaseName().AsUTF8Unsafe(), "MANIFEST",
+ base::CompareCase::SENSITIVE)) {
file_type_ = kManifest;
- else if (path.MatchesExtension(table_extension))
+ } else if (path.MatchesExtension(table_extension)) {
file_type_ = kTable;
+ }
parent_dir_ =
base::FilePath::FromUTF8Unsafe(fname).DirName().AsUTF8Unsafe();
}

Powered by Google App Engine
This is Rietveld 408576698