Skip to content
  • Damien George's avatar
    py/lexer: Use strcmp to make keyword searching more efficient. · ae436797
    Damien George authored
    Since the table of keywords is sorted, we can use strcmp to do the search
    and stop part way through the search if the comparison is less-than.
    
    Because all tokens that are names are subject to this search, this
    optimisation will improve the overall speed of the lexer when processing
    a script.
    
    The change also decreases code size by a little bit because we now use
    strcmp instead of the custom str_strn_equal function.
    ae436797