Skip to content

Commit

Permalink
little refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
gobwas committed Oct 16, 2017
1 parent 1f9c0e9 commit b758fc6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion nonce.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func randBytes(n int) []byte {
return bts
}

func newNonce(dest []byte) {
func putNewNonce(dest []byte) {
base64.StdEncoding.Encode(dest, randBytes(nonceKeySize))
}

Expand Down
7 changes: 0 additions & 7 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,3 @@ func (u Upgrader) Upgrade(conn io.ReadWriter) (hs Handshake, err error) {
func headerWriterSecVersion(w io.Writer) {
w.Write(btsErrorVersion)
}

func nonZero(a, b int) int {
if a != 0 {
return a
}
return b
}
7 changes: 7 additions & 0 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,10 @@ func min(a, b int) int {
}
return b
}

func nonZero(a, b int) int {
if a != 0 {
return a
}
return b
}

0 comments on commit b758fc6

Please sign in to comment.