Skip to content

fix: enforce minimal encoding#99

Merged
Stebalien merged 1 commit intomasterfrom
fix/minimal-encoding
Feb 4, 2020
Merged

fix: enforce minimal encoding#99
Stebalien merged 1 commit intomasterfrom
fix/minimal-encoding

Conversation

@Stebalien
Copy link
Copy Markdown
Member

Note: this removes two errors that don't appear to be used by anyone.

Note: this removes two errors that don't appear to be used by anyone.
@Stebalien Stebalien requested a review from Kubuxu February 4, 2020 04:57
buf := make([]byte, 2*binary.MaxVarintLen64+hashlen)
n := binary.PutUvarint(buf, 1)
n += binary.PutUvarint(buf[n:], codecType)
buf := make([]byte, 1+varint.UvarintSize(codecType)+hashlen)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to say, "let's just keep it a static allocation as it gives compiler more freedom" but it is already +hashlen so it doesn't matter.

@Stebalien Stebalien merged commit 72cd3d3 into master Feb 4, 2020
@Stebalien
Copy link
Copy Markdown
Member Author

Thanks @Kubuxu!

@Stebalien Stebalien deleted the fix/minimal-encoding branch February 4, 2020 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants