mirror of
https://github.com/NixOS/nix
synced 2025-06-26 20:01:15 +02:00
don't repeatedly look up ast internal symbols
these symbols are used a *lot*, so it makes sense to cache them. this mostly increases clarity of the code (however clear one may wish to call the parser desugaring here), but it also provides a small performance benefit.
This commit is contained in:
parent
b596cc9e79
commit
09a1128d9e
5 changed files with 36 additions and 15 deletions
|
@ -140,6 +140,11 @@ std::string showAttrPath(const SymbolTable & symbols, const AttrPath & attrPath)
|
|||
|
||||
struct Expr
|
||||
{
|
||||
struct AstSymbols {
|
||||
Symbol sub, lessThan, mul, div, or_, findFile, nixPath, body;
|
||||
};
|
||||
|
||||
|
||||
static unsigned long nrExprs;
|
||||
Expr() {
|
||||
nrExprs++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue