File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -400,7 +400,13 @@ class QUICConnection {
400400 * This is the source connection ID.
401401 */
402402 public get connectionId ( ) {
403- return new QUICConnectionId ( this . conn . sourceId ( ) ) ;
403+ const sourceId = this . conn . sourceId ( ) ;
404+ // Zero copy construction of QUICConnectionId
405+ return new QUICConnectionId (
406+ sourceId . buffer ,
407+ sourceId . byteOffset ,
408+ sourceId . byteLength ,
409+ ) ;
404410 }
405411
406412 /**
@@ -409,7 +415,13 @@ class QUICConnection {
409415 */
410416 @ready ( new errors . ErrorQUICConnectionNotRunning ( ) )
411417 public get connectionIdPeer ( ) {
412- return new QUICConnectionId ( this . conn . destinationId ( ) ) ;
418+ const destinationId = this . conn . destinationId ( ) ;
419+ // Zero copy construction of QUICConnectionId
420+ return new QUICConnectionId (
421+ destinationId . buffer ,
422+ destinationId . byteOffset ,
423+ destinationId . byteLength ,
424+ ) ;
413425 }
414426
415427 /**
You can’t perform that action at this time.
0 commit comments