Skip to content

Commit

Permalink
Re-expressed size constants for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
oxtoacart committed Nov 29, 2014
1 parent 466afa7 commit 4b31945
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions framed.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ import (
)

const (
// FrameHeaderBits is the size of the frame header in bits
FrameHeaderBits = 16

// FrameHeaderSize is the size of the frame header in bytes
FrameHeaderSize = 2
FrameHeaderSize = 16 / 2

This comment has been minimized.

Copy link
@aranhoide

aranhoide Dec 1, 2014

So, 8 bytes? I think the old value was correct. That said, this is not used anywhere AFAICT, so maybe you want to just remove it? (P.S.: I saw it's actually used in waddell)

This comment has been minimized.

Copy link
@oxtoacart

oxtoacart Dec 1, 2014

Author Contributor

Good catch! It's actually 2 bytes. Fixing.

This comment has been minimized.

Copy link
@oxtoacart

oxtoacart Dec 1, 2014

Author Contributor

Oh, and it's an exported constant that's used in waddell.


// MaxFrameSize is the maximum possible size of a frame (not including the
// length prefix)
MaxFrameSize = 65535
MaxFrameSize = 1<<FrameHeaderBits - 1
)

var endianness = binary.LittleEndian
Expand Down

0 comments on commit 4b31945

Please sign in to comment.