Pārlūkot izejas kodu

tweaking

--HG--
branch : dev
tags/0.1.2
mikespook pirms 12 gadiem
vecāks
revīzija
3051e6fe4b
1 mainītis faili ar 3 papildinājumiem un 4 dzēšanām
  1. +3
    -4
      worker/job.go

+ 3
- 4
worker/job.go Parādīt failu

@@ -46,15 +46,14 @@ func decodeJob(data []byte) (job *Job, err error) {
// Encode a job to byte slice
func (job *Job) Encode() (data []byte) {
l := len(job.Data)
tl := l
if job.Handle != "" {
tl += len(job.Handle) + 1
l += len(job.Handle) + 1
}
data = make([]byte, 0, tl + 12)
data = make([]byte, 0, l + 12)

magiccode := common.Uint32ToBytes(job.magicCode)
datatype := common.Uint32ToBytes(job.DataType)
datalength := common.Uint32ToBytes(uint32(tl))
datalength := common.Uint32ToBytes(uint32(l))

data = append(data, magiccode[:]...)
data = append(data, datatype[:]...)


Notiek ielāde…
Atcelt
Saglabāt