Update util/file/string_file.cc for new base/numerics API
The code was not incorrect before, but this expression is simpler. Upstream of change made at https://codereview.chromium.org/2528243002. R=mark@chromium.org BUG=chromium:668713 Change-Id: Idae36bd8312666a3254eda02713869776fec0248 Reviewed-on: https://chromium-review.googlesource.com/417981 Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Родитель
f66d5df30c
Коммит
6b09b08a22
|
@ -157,17 +157,16 @@ FileOffset StringFile::Seek(FileOffset offset, int whence) {
|
|||
LOG(ERROR) << "Seek(): new_offset invalid";
|
||||
return -1;
|
||||
}
|
||||
FileOffset new_offset_fileoffset = new_offset.ValueOrDie();
|
||||
size_t new_offset_sizet;
|
||||
if (!AssignIfInRange(&new_offset_sizet, new_offset_fileoffset)) {
|
||||
LOG(ERROR) << "Seek(): new_offset " << new_offset_fileoffset
|
||||
if (!new_offset.AssignIfValid(&new_offset_sizet)) {
|
||||
LOG(ERROR) << "Seek(): new_offset " << new_offset.ValueOrDie()
|
||||
<< " invalid for size_t";
|
||||
return -1;
|
||||
}
|
||||
|
||||
offset_ = new_offset_sizet;
|
||||
|
||||
return offset_.ValueOrDie();
|
||||
return base::ValueOrDieForType<FileOffset>(offset_);
|
||||
}
|
||||
|
||||
} // namespace crashpad
|
||||
|
|
Загрузка…
Ссылка в новой задаче