Skip to content

Commit

Permalink
feat: small speed up to constructing outgoing packets (#1354)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Dec 19, 2023
1 parent 6c15325 commit 517d7d0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/zeroconf/_protocol/outgoing.pxd
Expand Up @@ -50,17 +50,17 @@ cdef class DNSOutgoing:
cdef public cython.list authorities
cdef public cython.list additionals

cpdef _reset_for_next_packet(self)
cpdef void _reset_for_next_packet(self)

cdef _write_byte(self, cython.uint value)
cdef void _write_byte(self, cython.uint value)

cdef void _insert_short_at_start(self, unsigned int value)

cdef _replace_short(self, cython.uint index, cython.uint value)
cdef void _replace_short(self, cython.uint index, cython.uint value)

cdef _get_short(self, cython.uint value)

cdef _write_int(self, object value)
cdef void _write_int(self, object value)

cdef cython.bint _write_question(self, DNSQuestion question)

Expand All @@ -73,7 +73,7 @@ cdef class DNSOutgoing:
cdef cython.bint _write_record(self, DNSRecord record, double now)

@cython.locals(class_=cython.uint)
cdef _write_record_class(self, DNSEntry record)
cdef void _write_record_class(self, DNSEntry record)

@cython.locals(
start_size_int=object
Expand All @@ -91,7 +91,7 @@ cdef class DNSOutgoing:

cdef bint _has_more_to_add(self, unsigned int questions_offset, unsigned int answer_offset, unsigned int authority_offset, unsigned int additional_offset)

cdef _write_ttl(self, DNSRecord record, double now)
cdef void _write_ttl(self, DNSRecord record, double now)

@cython.locals(
labels=cython.list,
Expand All @@ -100,16 +100,16 @@ cdef class DNSOutgoing:
start_size=cython.uint,
name_length=cython.uint,
)
cpdef write_name(self, cython.str name)
cpdef void write_name(self, cython.str name)

cdef _write_link_to_name(self, unsigned int index)
cdef void _write_link_to_name(self, unsigned int index)

cpdef write_short(self, cython.uint value)
cpdef void write_short(self, cython.uint value)

cpdef write_string(self, cython.bytes value)
cpdef void write_string(self, cython.bytes value)

@cython.locals(utfstr=bytes)
cpdef _write_utf(self, cython.str value)
cdef void _write_utf(self, cython.str value)

@cython.locals(
debug_enable=bint,
Expand Down

0 comments on commit 517d7d0

Please sign in to comment.