gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet-nim] branch master updated: use nicer new syntax


From: gnunet
Subject: [GNUnet-SVN] [gnunet-nim] branch master updated: use nicer new syntax
Date: Mon, 06 Aug 2018 21:02:07 +0200

This is an automated email from the git hooks/post-receive script.

lurchi pushed a commit to branch master
in repository gnunet-nim.

The following commit(s) were added to refs/heads/master by this push:
     new 1e4a1dd  use nicer new syntax
1e4a1dd is described below

commit 1e4a1dd742b2a5824e748f2b6c801000b9de5048
Author: lurchi <address@hidden>
AuthorDate: Mon Aug 6 21:01:54 2018 +0200

    use nicer new syntax
---
 asynccadet.nim | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/asynccadet.nim b/asynccadet.nim
index 1e5716c..51f6ae7 100644
--- a/asynccadet.nim
+++ b/asynccadet.nim
@@ -30,8 +30,7 @@ proc channelConnectCb(cls: pointer,
                       gnunetChannel: ptr GNUNET_CADET_Channel,
                       source: ptr GNUNET_PeerIdentity): pointer {.cdecl.} =
   var port = cast[ptr CadetPort](cls)
-  var channel: ref CadetChannel
-  new(channel)
+  let channel = new(CadetChannel)
   channel.handle = gnunetChannel
   channel.peer = GNUNET_PeerIdentity(public_key: source.public_key)
   channel.messages = newFutureStream[string]()
@@ -83,8 +82,7 @@ proc sendMessage*(channel: ref CadetChannel, payload: string) 
=
 proc openPort*(handle: ref CadetHandle, port: string): ref CadetPort =
   var handlers = messageHandlers()
   var port = hashString(port)
-  var openPort: ref CadetPort
-  new(openPort)
+  var openPort = new(CadetPort)
   openPort.channels = newFutureStream[ref CadetChannel]()
   openPort.handle = GNUNET_CADET_open_port(handle.handle,
                                            addr port,
@@ -114,8 +112,7 @@ proc createChannel*(handle: ref CadetHandle,
                                                      addr 
peerIdentity.public_key)
   var handlers = messageHandlers()
   var port = hashString(port)
-  var channel: ref CadetChannel
-  new(channel)
+  var channel = new(CadetChannel)
   channel.peer = peerIdentity
   channel.messages = newFutureStream[string]("createChannel")
   channel.handle = GNUNET_CADET_channel_create(handle.handle,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]