From fc7f5501e0d5690792d3de66614764b5dea71982 Mon Sep 17 00:00:00 2001 From: saxon Date: Tue, 8 Jan 2019 20:04:45 +1030 Subject: [PATCH] psi: removed conditional in HasTime and HasLocation and just used result of logic operation --- stream/mts/psi/helpers.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/stream/mts/psi/helpers.go b/stream/mts/psi/helpers.go index b04e9f76..15029e36 100644 --- a/stream/mts/psi/helpers.go +++ b/stream/mts/psi/helpers.go @@ -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 // - if so return nil, otherwise return error func HasTime(p []byte) bool { - if p[TimeTagIndx] == TimeDescTag { - return true - } - return false + return p[TimeTagIndx] == TimeDescTag } // 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 func HasLocation(p []byte) bool { - if p[LocationTagIndx] == LocationDescTag { - return true - } - return false + return p[LocationTagIndx] == LocationDescTag } // UpdateTime takes the byte slice representation of a psi-pmt as well as a time