mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-29 01:51:43 +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 =
|
proc readAllFile(file: TFile, len: int): string =
|
||||||
# We aquire the filesize beforehand and hope it doesn't change.
|
# We aquire the filesize beforehand and hope it doesn't change.
|
||||||
# Speeds things up.
|
# Speeds things up.
|
||||||
if len >= high(int):
|
|
||||||
raiseEIO("file too big to fit in memory")
|
|
||||||
result = newString(int(len))
|
result = newString(int(len))
|
||||||
if readBuffer(file, addr(result[0]), int(len)) != len:
|
if readBuffer(file, addr(result[0]), int(len)) != len:
|
||||||
raiseEIO("error while reading from file")
|
raiseEIO("error while reading from file")
|
||||||
|
|||||||
Reference in New Issue
Block a user