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

Unified Diff: base/files/file_util_win.cc

Issue 2577163002: A follow-up nit fix for jumplist file operations (Closed)
Patch Set: Created 4 years 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: base/files/file_util_win.cc
diff --git a/base/files/file_util_win.cc b/base/files/file_util_win.cc
index 629658447d848b53630c2638d4ae478990ba498b..81121f213693a3431f440c79b30f48c8a179d3cb 100644
--- a/base/files/file_util_win.cc
+++ b/base/files/file_util_win.cc
@@ -177,10 +177,7 @@ bool CopyDirectory(const FilePath& from_path, const FilePath& to_path,
FilePath real_from_path = MakeAbsoluteFilePath(from_path);
if (real_from_path.empty())
return false;
- // Note: it's important to use IsParent() here as string comparison would
- // result in a false negative, e.g. on C:\bar\Foo versus C:\bar\FooOld.
chengx 2016/12/15 19:51:54 grt@ nit: i think this comment is unnecessary. th
- if (real_to_path.value().size() >= real_from_path.value().size() &&
- real_from_path.IsParent(real_to_path)) {
chengx 2016/12/15 19:51:54 grt@ this "optimization" seems wrong to me -- eit
+ if (real_to_path == real_from_path || real_from_path.IsParent(real_to_path)) {
grt (UTC plus 2) 2016/12/15 21:28:32 nit: no braces
return false;
}

Powered by Google App Engine
This is Rietveld 408576698