Skip to content

Commit 6a69baa

Browse files
committed
Remove obsolete field type assertions
1 parent 7d9bfb7 commit 6a69baa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

base/stream.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ function isopen(x::Union{LibuvStream, LibuvServer})
378378
if x.status == StatusUninit || x.status == StatusInit
379379
throw(ArgumentError("$x is not initialized"))
380380
end
381-
return x.status::Int != StatusClosed && x.status::Int != StatusEOF
381+
return x.status != StatusClosed && x.status != StatusEOF
382382
end
383383

384384
function check_open(x::Union{LibuvStream, LibuvServer})
@@ -453,7 +453,7 @@ function close(stream::Union{LibuvStream, LibuvServer})
453453
stream.status = StatusClosing
454454
elseif isopen(stream) || stream.status == StatusEOF
455455
should_wait = uv_handle_data(stream) != C_NULL
456-
if stream.status::Int != StatusClosing
456+
if stream.status != StatusClosing
457457
ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), stream.handle)
458458
stream.status = StatusClosing
459459
end
@@ -468,7 +468,7 @@ function uvfinalize(uv::Union{LibuvStream, LibuvServer})
468468
iolock_begin()
469469
if uv.handle != C_NULL
470470
disassociate_julia_struct(uv.handle) # not going to call the usual close hooks
471-
if uv.status::Int != StatusUninit
471+
if uv.status != StatusUninit
472472
close(uv)
473473
else
474474
Libc.free(uv.handle)
@@ -582,7 +582,7 @@ function uv_alloc_buf(handle::Ptr{Cvoid}, size::Csize_t, buf::Ptr{Cvoid})
582582
stream = unsafe_pointer_to_objref(hd)::LibuvStream
583583

584584
local data::Ptr{Cvoid}, newsize::Csize_t
585-
if stream.status::Int != StatusActive
585+
if stream.status != StatusActive
586586
data = C_NULL
587587
newsize = 0
588588
else
@@ -615,7 +615,7 @@ function uv_readcb(handle::Ptr{Cvoid}, nread::Cssize_t, buf::Ptr{Cvoid})
615615
if isa(stream, TTY)
616616
stream.status = StatusEOF # libuv called uv_stop_reading already
617617
notify(stream.cond)
618-
elseif stream.status::Int != StatusClosing
618+
elseif stream.status != StatusClosing
619619
# begin shutdown of the stream
620620
ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), stream.handle)
621621
stream.status = StatusClosing
@@ -725,7 +725,7 @@ show(io::IO, stream::Pipe) = print(io,
725725

726726
function open_pipe!(p::PipeEndpoint, handle::OS_HANDLE)
727727
iolock_begin()
728-
if p.status::Int != StatusInit
728+
if p.status != StatusInit
729729
error("pipe is already in use or has been closed")
730730
end
731731
err = ccall(:uv_pipe_open, Int32, (Ptr{Cvoid}, OS_HANDLE), p.handle, handle)
@@ -1119,7 +1119,7 @@ _fd(x::Union{OS_HANDLE, RawFD}) = x
11191119

11201120
function _fd(x::Union{LibuvStream, LibuvServer})
11211121
fd = Ref{OS_HANDLE}(INVALID_OS_HANDLE)
1122-
if x.status::Int != StatusUninit && x.status::Int != StatusClosed
1122+
if x.status != StatusUninit && x.status != StatusClosed
11231123
err = ccall(:uv_fileno, Int32, (Ptr{Cvoid}, Ptr{OS_HANDLE}), x.handle, fd)
11241124
# handle errors by returning INVALID_OS_HANDLE
11251125
end

0 commit comments

Comments
 (0)