| Age | Commit message (Collapse) | Author |
|
|
|
Cleaner to just check for more tokens in the few spots that used it.
Seems slightly faster too, though it might be in the noise.
|
|
The most common case by far (> 85% for both && and || with the x86
Kconfigs) is a single operand (i.e., no && or ||). Sticking it in a list
and then immediately throwing the list away is wasteful.
Makes _parse_expr() at least 10% faster during testing.
|
|
|
|
Matches their function.
|
|
Instantiating that nested function with free variables turned out to be
quite expensive in cProfile.
For the _build_dep() case, it would be even neater to have a function
like _add_sym_deps(sym, expr) that adds 'sym' to each 'deps' set in
'expr', removing the need for a temporary set. Unfortunately,
_get_expr_syms() is used elsewhere too, and it's probably not worthwhile
having another very similar function just as a small optimization.
|
|
|
|
|
|
|
|
Simpler.
|
|
|
|
|
|
Speeds _Feed creation up a bit during tokenization. Keep public classes
slotless for flexibility.
|
|
Optimization. Saves an 'if None' check for each 'help'.
|
|
Small optimization. No need to fetch it for 'help' tokens, which return
early.
|
|
The regexes handle most stripping of trailing space now too.
|
|
|
|
|
|
- Get rid of the weird strip/reindex dance and keep 's' intact
throughout. This also fixes _tokenization_error() output, as it would
previously report the stripped string.
- Strip trailing whitespace in the regexes. This makes the stripping
loop very cheap.
- Shorten a comment that might've been more confusing than helpful.
|
|
We're never updating nodes here, since the original expressions should
be preserved. We're just trying to avoid creating redundant nodes.
|
|
|
|
Only way it's used.
|
|
The line number was previously for logical lines only. Oversight.
Get rid of _get_lines() and keep the raw lines in _FileFeed instead,
only joining lines with continuation lines as they are fetched. This
makes the index correspond to the correct line number from the file. (It
also means most lines are returned as-is without any logic applied to
them, which is nice.)
Litter tests/Klocation with continuation lines to get test coverage.
Remove some unused functions that were previously inherited from _Feed
and remove it as a base class of _FileFeed.
|
|
|
|
Internal details are already assumed.
|
|
|
|
None should never appear as a subexpression.
|
|
|
|
Single trivial user.
|
|
Bit overengineered. Not performance-sensitive.
|
|
Dubious value and poorly named. Also rearrange cases by frequency.
|
|
|
|
Bit more standard.
Piggyback space nit.
|
|
|
|
|
|
Keeps a consistent indentation for extra lines in parameter
descriptions. More compact too.
Also fix parameter name documentation mismatch for
Config.__getitem__().
|
|
|
|
It will be recalculated in get_value() if cached_val is None.
|
|
Other internal details are already needed/used in those spots.
|
|
These never trigger for the x86 Kconfigs, wasting time instead.
|
|
|
|
Order things consistently, make a bit more compact, add some comments.
|
|
|
|
Leave the regex helper functions lowercase, as they're conceptually the
same as other global functions.
|
|
Oversight. No functional changes, but less cryptic than creating it
dynamically.
Also comment and rearrange a bit.
|
|
It will pin it to "y", meaning it's non-modifiable. No need to go on.
Maybe some common code should be extracted here too.
|
|
rev_dep == "m" is relatively rare, so check it first.
|
|
Not sure why I used that form the first time around.
|
|
The parsing routines know it all re. item representations.
|
|
More common.
|