o
    aÄŽi,  ã                   @  s   d Z ddlmZ ddd	„Zd
S )z3Binary search function for Unicode interval tables.é    )ÚannotationsÚucsÚintÚtableútuple[tuple[int, int], ...]Úreturnc                 C  sŒ   d}t |ƒd }| |d d k s| || d krdS ||krD|| d }| || d kr1|d }n| || d k r>|d }ndS ||ksdS )a  
    Binary search in interval table.

    :param ucs: Ordinal value of unicode character.
    :param table: Tuple of starting and ending ranges of ordinal values,
        in form of ``((start, end), ...)``.
    :returns: 1 if ordinal value ucs is found within lookup table, else 0.
    r   é   é   )Úlen)r   r   ÚlboundÚuboundÚmid© r   úL/home/jeff/fluffinator/venv/lib/python3.10/site-packages/wcwidth/bisearch.pyÚbisearch   s   	 

ù	r   N)r   r   r   r   r   r   )Ú__doc__Ú
__future__r   r   r   r   r   r   Ú<module>   s    