【联锁消息发送Encode处理】
This commit is contained in:
parent
f8dba22a23
commit
231be3b506
5
third_party/message/interlock.go
vendored
5
third_party/message/interlock.go
vendored
@ -77,10 +77,9 @@ func (m *InterlockSendMsgPkg) Encode() []byte {
|
||||
// bool数组转byte
|
||||
func boolsToByte(flags [8]bool) byte {
|
||||
var result uint8
|
||||
for _, b := range flags {
|
||||
result <<= 1
|
||||
for index, b := range flags {
|
||||
if b {
|
||||
result |= 1
|
||||
result = result + (1 << index)
|
||||
}
|
||||
}
|
||||
return result
|
||||
|
Loading…
Reference in New Issue
Block a user