mirror of https://bitbucket.org/ausocean/av.git
psi: removed conditional in HasTime and HasLocation and just used result of logic operation
This commit is contained in:
parent
d665bece23
commit
fc7f5501e0
|
@ -44,19 +44,13 @@ func TimeBytes(t uint64) []byte {
|
||||||
// HasTime takes a psi as a byte slice and checks to see if it has a time descriptor
|
// HasTime takes a psi as a byte slice and checks to see if it has a time descriptor
|
||||||
// - if so return nil, otherwise return error
|
// - if so return nil, otherwise return error
|
||||||
func HasTime(p []byte) bool {
|
func HasTime(p []byte) bool {
|
||||||
if p[TimeTagIndx] == TimeDescTag {
|
return p[TimeTagIndx] == TimeDescTag
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// HasLocation takes a psi as a byte slice and checks to see if it has a location descriptor
|
// HasLocation takes a psi as a byte slice and checks to see if it has a location descriptor
|
||||||
// - if so return nil, otherwise return error
|
// - if so return nil, otherwise return error
|
||||||
func HasLocation(p []byte) bool {
|
func HasLocation(p []byte) bool {
|
||||||
if p[LocationTagIndx] == LocationDescTag {
|
return p[LocationTagIndx] == LocationDescTag
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateTime takes the byte slice representation of a psi-pmt as well as a time
|
// UpdateTime takes the byte slice representation of a psi-pmt as well as a time
|
||||||
|
|
Loading…
Reference in New Issue