Skip to content

Commit

Permalink
Keep bool fields together in context struct defn
Browse files Browse the repository at this point in the history
Based on feedback from PR:

> Putting all the bool fields consecutively at the
end avoids padding bytes in the middle of the struct
that the compiler will add to maintain the alignment
requirements of the bigger slice fields.
  • Loading branch information
Vinay P committed Jul 2, 2020
1 parent 7aa42ac commit 1bf6f19
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions log/log.go
Expand Up @@ -133,9 +133,8 @@ func WithSuffix(logger Logger, keyvals ...interface{}) Logger {
type context struct {
logger Logger
keyvals []interface{}
sKeyvals []interface{} // suffixes
hasValuer bool
// suffixes
sKeyvals []interface{}
sHasValuer bool
}

Expand Down

0 comments on commit 1bf6f19

Please sign in to comment.