mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
sysio: got rid of now unnecessary length check
This commit is contained in:
@@ -112,8 +112,6 @@ proc rawFileSize(file: TFile): int =
|
||||
proc readAllFile(file: TFile, len: int): string =
|
||||
# We aquire the filesize beforehand and hope it doesn't change.
|
||||
# Speeds things up.
|
||||
if len >= high(int):
|
||||
raiseEIO("file too big to fit in memory")
|
||||
result = newString(int(len))
|
||||
if readBuffer(file, addr(result[0]), int(len)) != len:
|
||||
raiseEIO("error while reading from file")
|
||||
|
||||
Reference in New Issue
Block a user