mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-19 15:02:10 +00:00
Use &struct{} instead of new
This commit is contained in:
1 parent
cc3f374623
commit
12ea3b8e28
7 files changed
+53
-50
No files matched your search
+8
-8
@@ -15,10 +15,10 @@ type CryptionReader struct {
|
||||
}
|
||||
|
||||
func NewCryptionReader(stream cipher.Stream, reader io.Reader) *CryptionReader {
|
||||
this := new(CryptionReader)
|
||||
this.stream = stream
|
||||
this.reader = reader
|
||||
return this
|
||||
return &CryptionReader{
|
||||
stream: stream,
|
||||
reader: reader,
|
||||
}
|
||||
}
|
||||
|
||||
// Read reads blocks from underlying reader, the length of blocks must be
|
||||
@@ -42,10 +42,10 @@ type CryptionWriter struct {
|
||||
}
|
||||
|
||||
func NewCryptionWriter(stream cipher.Stream, writer io.Writer) *CryptionWriter {
|
||||
this := new(CryptionWriter)
|
||||
this.stream = stream
|
||||
this.writer = writer
|
||||
return this
|
||||
return &CryptionWriter{
|
||||
stream: stream,
|
||||
writer: writer,
|
||||
}
|
||||
}
|
||||
|
||||
// Write writes the give blocks to underlying writer. The length of the blocks
|
||||
|
||||
Reference in new issue
Block a user