Skip to content

Commit af3d18f

Browse files
should close file() (#40)
I got warnings running this about unused connection, best to explicitly close()
1 parent d97a030 commit af3d18f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

perf.R

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ timeit("parse_integers", parseintperf, 1000)
4343

4444
printfdperf = function(t) {
4545
fd<-file("/dev/null")
46+
on.exit(close(fd))
4647
for (i in 1:t) {
4748
s = sprintf("%d %d", i, i+1)
4849
writeLines(s, fd)

0 commit comments

Comments
 (0)