mirror of https://bitbucket.org/ausocean/av.git
stream/mts/psi/psi.go: simplified HasDescriptor func
This commit is contained in:
parent
dce113d1e4
commit
3a14b64480
|
@ -261,12 +261,10 @@ func (p *PSIBytes) HasDescriptor(tag int) Descriptor {
|
|||
if descs == nil {
|
||||
return nil
|
||||
}
|
||||
for i := 0; i < len(descs); {
|
||||
t := int(descs[i])
|
||||
if t == tag {
|
||||
for i := 0; i < len(descs); i += 2 + int(descs[i+1]) {
|
||||
if int(descs[i]) == tag {
|
||||
return descs[i : i+2+int(descs[i+1])]
|
||||
}
|
||||
i += 2 + int(descs[i+1])
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue