Skip to content

Commit f8a8b9b

Browse files
committed
readfloat[orNA](io): avoid reinterpret()
reinterpret() returns ReinterpretArray in 0.7 instead of Vector, whereas RVector{} only accepts Vector
1 parent 66aeb9b commit f8a8b9b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/io/XDRIO.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ end
1010

1111
readint32(io::XDRIO) = ntoh(read(io.sub, Int32))
1212
readuint32(io::XDRIO) = ntoh(read(io.sub, UInt32))
13-
readfloat64(io::XDRIO) = reinterpret(Float64, ntoh(read(io.sub, Int64)))
13+
readfloat64(io::XDRIO) = ntoh(read(io.sub, Float64))
1414

1515
readintorNA(io::XDRIO) = readint32(io)
1616
function readintorNA(io::XDRIO, n::RVecLength)
@@ -22,8 +22,8 @@ end
2222
# R's NA is silently converted to NaN when the value is loaded in the register(?)
2323
#readfloatorNA(io::XDRIO) = readfloat64(io)
2424
function readfloatorNA(io::XDRIO, n::RVecLength)
25-
v = read(io.sub, UInt64, n)
26-
reinterpret(Float64, map!(ntoh, v, v))
25+
v = read(io.sub, Float64, n)
26+
map!(ntoh, v, v)
2727
end
2828

2929
readuint8(io::XDRIO, n::RVecLength) = read(io.sub, UInt8, n)

0 commit comments

Comments
 (0)