mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-06 18:21:39 +08:00
history_file_contents_t::create: remove constant comparison
static_cast<unsigned long>(off_t len) is always < SIZE_MAX
This commit is contained in:
parent
338d587f2a
commit
d7b4193978
@ -157,7 +157,7 @@ bool history_file_contents_t::infer_file_type() {
|
||||
std::unique_ptr<history_file_contents_t> history_file_contents_t::create(int fd) {
|
||||
// Check that the file is seekable, and its size.
|
||||
off_t len = lseek(fd, 0, SEEK_END);
|
||||
if (len <= 0 || static_cast<unsigned long>(len) >= SIZE_MAX) return nullptr;
|
||||
if (len <= 0) return nullptr;
|
||||
|
||||
bool mmap_file_directly = should_mmap();
|
||||
std::unique_ptr<mmap_region_t> region =
|
||||
|
Loading…
x
Reference in New Issue
Block a user