forked from quic-go/quic-go
remove ConnectionID.Equal function
Connection IDs can now be compared with ==.
This commit is contained in:
@@ -86,11 +86,6 @@ func ReadConnectionID(r io.Reader, l int) (ConnectionID, error) {
|
||||
return c, err
|
||||
}
|
||||
|
||||
// Equal says if two connection IDs are equal
|
||||
func (c ConnectionID) Equal(other ConnectionID) bool {
|
||||
return c == other
|
||||
}
|
||||
|
||||
// Len returns the length of the connection ID in bytes
|
||||
func (c ConnectionID) Len() int {
|
||||
return int(c.l)
|
||||
|
||||
@@ -43,18 +43,6 @@ var _ = Describe("Connection ID generation", func() {
|
||||
Expect(has20ByteConnID).To(BeTrue())
|
||||
})
|
||||
|
||||
It("says if connection IDs are equal", func() {
|
||||
c1 := ParseConnectionID([]byte{1, 2, 3, 4, 5, 6, 7, 8})
|
||||
c2 := ParseConnectionID([]byte{8, 7, 6, 5, 4, 3, 2, 1})
|
||||
c3 := ParseConnectionID([]byte{1, 2, 3, 4, 5, 6, 7, 8})
|
||||
Expect(c1.Equal(c1)).To(BeTrue())
|
||||
Expect(c1.Equal(c3)).To(BeTrue())
|
||||
Expect(c2.Equal(c2)).To(BeTrue())
|
||||
Expect(c2.Equal(c3)).To(BeFalse())
|
||||
Expect(c1.Equal(c2)).To(BeFalse())
|
||||
Expect(c2.Equal(c1)).To(BeFalse())
|
||||
})
|
||||
|
||||
It("reads the connection ID", func() {
|
||||
buf := bytes.NewBuffer([]byte{1, 2, 3, 4, 5, 6, 7, 8, 9})
|
||||
c, err := ReadConnectionID(buf, 9)
|
||||
|
||||
Reference in New Issue
Block a user