zmq: remove unnecessary 'var' decls from high-level procs
This commit is contained in:
parent
1ce30b9e10
commit
6e42513acd
1 changed files with 3 additions and 4 deletions
|
|
@ -299,12 +299,12 @@ proc open*(address: string, server: bool, mode: TConnectionMode = conDEALER,
|
||||||
else:
|
else:
|
||||||
if connect(result.s, address) != 0'i32: zmqError()
|
if connect(result.s, address) != 0'i32: zmqError()
|
||||||
|
|
||||||
proc close*(c: var TConnection) =
|
proc close*(c: TConnection) =
|
||||||
## closes the connection.
|
## closes the connection.
|
||||||
if close(c.s) != 0'i32: zmqError()
|
if close(c.s) != 0'i32: zmqError()
|
||||||
if term(c.c) != 0'i32: zmqError()
|
if term(c.c) != 0'i32: zmqError()
|
||||||
|
|
||||||
proc send*(c: var TConnection, msg: string) =
|
proc send*(c: TConnection, msg: string) =
|
||||||
## sends a message over the connection.
|
## sends a message over the connection.
|
||||||
var m: TMsg
|
var m: TMsg
|
||||||
if msg_init(m, msg.len) != 0'i32: zmqError()
|
if msg_init(m, msg.len) != 0'i32: zmqError()
|
||||||
|
|
@ -312,7 +312,7 @@ proc send*(c: var TConnection, msg: string) =
|
||||||
if send(c.s, m, 0'i32) != 0'i32: zmqError()
|
if send(c.s, m, 0'i32) != 0'i32: zmqError()
|
||||||
discard msg_close(m)
|
discard msg_close(m)
|
||||||
|
|
||||||
proc receive*(c: var TConnection): string =
|
proc receive*(c: TConnection): string =
|
||||||
## receives a message from a connection.
|
## receives a message from a connection.
|
||||||
var m: TMsg
|
var m: TMsg
|
||||||
if msg_init(m) != 0'i32: zmqError()
|
if msg_init(m) != 0'i32: zmqError()
|
||||||
|
|
@ -320,4 +320,3 @@ proc receive*(c: var TConnection): string =
|
||||||
result = newString(msg_size(m))
|
result = newString(msg_size(m))
|
||||||
copyMem(addr(result[0]), msg_data(m), result.len)
|
copyMem(addr(result[0]), msg_data(m), result.len)
|
||||||
discard msg_close(m)
|
discard msg_close(m)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue