diff options
author | Damien George <damien.p.george@gmail.com> | 2017-02-17 11:10:35 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-02-17 11:10:35 +1100 |
commit | ae436797927c3c9f7ccdc25dd78af3dd279ca7ff (patch) | |
tree | 360c3ed597002266f631d48ddab2e025a5e5dc94 /py/objarray.c | |
parent | a68c75468812859633814e90207faec1a361778e (diff) | |
download | micropython-ae436797927c3c9f7ccdc25dd78af3dd279ca7ff.tar.gz micropython-ae436797927c3c9f7ccdc25dd78af3dd279ca7ff.zip |
py/lexer: Use strcmp to make keyword searching more efficient.
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.
Diffstat (limited to 'py/objarray.c')
0 files changed, 0 insertions, 0 deletions