Commit 65a4aa0a authored by Bartek Nowierski's avatar Bartek Nowierski Committed by Commit Bot

Avoid double = and assign nullptr instead of 0

This is in preparation for transition to CheckedPtr (see go/miracleptr).
Assigning 0 to CheckedPtr is ambiguous.
Double = can be a problem, if only one of the fields gets converted to
CheckedPtr.

Bug: 1080832
Change-Id: I0ebc75e89b8d2ea0e7d63f4c0dcbcaab8aecf7b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2434022Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811499}
parent 514dce03
......@@ -14,7 +14,7 @@ namespace disk_cache {
void* MappedFile::Init(const base::FilePath& name, size_t size) {
DCHECK(!init_);
if (init_ || !File::Init(name))
return NULL;
return nullptr;
if (!size)
size = GetLength();
......@@ -26,7 +26,8 @@ void* MappedFile::Init(const base::FilePath& name, size_t size) {
} else {
free(buffer_);
free(snapshot_);
buffer_ = snapshot_ = 0;
buffer_ = nullptr;
snapshot_ = nullptr;
}
init_ = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment