Skip to content

Commit

Permalink
Remove unneeded casts
Browse files Browse the repository at this point in the history
BUG=None

Change-Id: I7c3f59373226115b221392691a051b260d6cfaf0
Reviewed-on: https://chromium-review.googlesource.com/772811
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516956}
  • Loading branch information
wfh-chromium authored and Commit Bot committed Nov 16, 2017
1 parent b1778be commit e754c46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion base/files/memory_mapped_file_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ bool MemoryMappedFile::MapFileRegionToMemory(
DPLOG(ERROR) << "fstat " << file_.GetPlatformFile();
return false;
}
if (!IsValueInRangeForNumericType<size_t>(static_cast<uint64_t>(file_len)))
if (!IsValueInRangeForNumericType<size_t>(file_len))
return false;
map_size = static_cast<size_t>(file_len);
length_ = map_size;
Expand Down
3 changes: 1 addition & 2 deletions base/files/memory_mapped_file_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ bool MemoryMappedFile::MapFileRegionToMemory(
if (region == MemoryMappedFile::Region::kWholeFile) {
DCHECK_NE(READ_WRITE_EXTEND, access);
int64_t file_len = file_.GetLength();
if (file_len <= 0 ||
!IsValueInRangeForNumericType<size_t>(static_cast<uint64_t>(file_len)))
if (file_len <= 0 || !IsValueInRangeForNumericType<size_t>(file_len))
return false;
length_ = static_cast<size_t>(file_len);
} else {
Expand Down

0 comments on commit e754c46

Please sign in to comment.