mirror of https://bitbucket.org/ausocean/av.git
psi: using binary.BigEndian.Uint64 for TimeFrom
This commit is contained in:
parent
f7991cd0af
commit
7c24c79287
|
@ -85,11 +85,7 @@ func TimeFrom(p []byte) (t uint64, err error) {
|
|||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
// TODO: could probably write a byte slice to int func, so that this would
|
||||
// be replaced by extraction of time data slice and then call to conversion func
|
||||
for i := range p[timeDataIndx : timeDataIndx+timeDataSize] {
|
||||
t |= uint64(p[i+timeDataIndx]) << uint(56-i*timeDataSize)
|
||||
}
|
||||
t = binary.BigEndian.Uint64(p[timeDataIndx : timeDataIndx+timeDataSize])
|
||||
return t, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue