mirror of
				https://github.com/aler9/gortsplib
				synced 2025-10-31 18:42:40 +08:00 
			
		
		
		
	modernize code (#884)
This commit is contained in:
		| @@ -7,11 +7,7 @@ import ( | ||||
| 	"github.com/stretchr/testify/require" | ||||
| ) | ||||
|  | ||||
| func uint16Ptr(v uint16) *uint16 { | ||||
| 	return &v | ||||
| } | ||||
|  | ||||
| func uint32Ptr(v uint32) *uint32 { | ||||
| func ptrOf[T any](v T) *T { | ||||
| 	return &v | ||||
| } | ||||
|  | ||||
| @@ -467,8 +463,8 @@ func TestEncode(t *testing.T) { | ||||
| 	for _, ca := range cases { | ||||
| 		t.Run(ca.name, func(t *testing.T) { | ||||
| 			e := &Encoder{ | ||||
| 				SSRC:                  uint32Ptr(0x9dbb7812), | ||||
| 				InitialSequenceNumber: uint16Ptr(0x44ed), | ||||
| 				SSRC:                  ptrOf(uint32(0x9dbb7812)), | ||||
| 				InitialSequenceNumber: ptrOf(uint16(0x44ed)), | ||||
| 				PayloadMaxSize:        400, | ||||
| 			} | ||||
| 			err := e.Init() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Alessandro Ros
					Alessandro Ros