Make flags marshallable #2

Merged
zeripath merged 2 commits from zeripath/log:marshal-flags into master 2019-06-03 07:59:43 +00:00
Owner

Flags should be marshallable.

Flags should be marshallable.
lunny requested changes 2019-05-26 08:50:50 +00:00
Dismissed
@ -35,3 +41,3 @@
)
var flagFromString = map[string]int{
var flagFromString = map[string]Flags{

I think since flagOrder is exist, this map is unnecessary. There is no performance difference between traversing map and traversing slice when there are some few items.

I think since `flagOrder` is exist, this map is unnecessary. There is no performance difference between traversing map and traversing slice when there are some few items.
Author
Owner

The index of the flagOrder array is not the value of the flag.

The index of the flagOrder array is not the value of the flag.

OK. This will not the blocker.

OK. This will not the blocker.
Author
Owner

Sorry I was being stupid - So long as we keep orderFlag in the same order as the declaration we can just use Flags(1<< uint64(i)) to get the flag value.

Sorry I was being stupid - So long as we keep orderFlag in the same order as the declaration we can just use `Flags(1<< uint64(i))` to get the flag value.
lunny approved these changes 2019-05-26 15:51:43 +00:00
Dismissed
jonasfranz approved these changes 2019-06-03 07:00:37 +00:00
Dismissed
zeripath closed this pull request 2019-06-03 07:59:43 +00:00
zeripath deleted branch marshal-flags 2019-06-03 07:59:57 +00:00
This repo is archived. You cannot comment on pull requests.
No description provided.