psi: HasTime rather than chkTime

This commit is contained in:
saxon 2018-12-14 16:11:45 +10:30
parent ac11b281c5
commit 0b9f0f49fe
1 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ func TimeBytes(t uint64) (s []byte) {
// ChkTime 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 ChkTime(p []byte) error {
func HasTime(p []byte) error {
if p[timeTagIndx] != timeDescTag {
return errors.New("PSI does not contain a time descriptor, cannot update")
}
@ -65,7 +65,7 @@ func HasLocation(p []byte) error {
// as an integer and attempts to update the time descriptor in the pmt with the
// given time if the time descriptor exists, otherwise an error is returned
func UpdateTime(d []byte, t uint64) error {
err := ChkTime(d)
err := HasTime(d)
if err != nil {
return err
}
@ -81,7 +81,7 @@ func UpdateTime(d []byte, t uint64) error {
// timestamp, returning as a uint64 if it exists, otherwise returning 0 and nil
// if it does not exist
func TimeFrom(p []byte) (t uint64, err error) {
err = ChkTime(p)
err = HasTime(p)
if err != nil {
return 0, err
}