func (cdc *Codec) getTypeInfoFromPrefix_rlock(iinfo *TypeInfo, pb PrefixBytes) (info *TypeInfo, err error) {
	// We do not use defer cdc.mtx.Unlock() here due to performance overhead of
	// defer in go1.11 (and prior versions). Ensure new code paths unlock the
	// mutex.
	cdc.mtx.RLock()

	infos, ok := iinfo.Implementers[pb]
	if !ok {
		err = fmt.Errorf("unrecognized prefix bytes %X", pb)
		cdc.mtx.RUnlock()
		return
	}
	if len(infos) > 1 {
		err = fmt.Errorf("conflicting concrete types registered for %X: e.g. %v and %v", pb, infos[0].Type, infos[1].Type)
		cdc.mtx.RUnlock()
		return
	}
	info = infos[0]
	cdc.mtx.RUnlock()
	return
}
func (cdc *Codec) getTypeInfoFromPrefix_rlock(iinfo *TypeInfo, pb PrefixBytes) (info *TypeInfo, err error) {
	// We do not use defer cdc.mtx.Unlock() here due to performance overhead of
	// defer in go1.11 (and prior versions). Ensure new code paths unlock the
	// mutex.
	cdc.mtx.RLock()

	infos, ok := iinfo.Implementers[pb]
	if !ok {
		err = fmt.Errorf("unrecognized prefix bytes %X", pb)
		cdc.mtx.RUnlock()
		return
	}
	if len(infos) > 1 {
		err = fmt.Errorf("conflicting concrete types registered for %X: e.g. %v and %v", pb, infos[0].Type, infos[1].Type)
		cdc.mtx.RUnlock()
		return
	}
	info = infos[0]
	cdc.mtx.RUnlock()
	return
}
// iinfo: TypeInfo for the interface for which we must decode a
// concrete type with prefix bytes pb.