diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-10-04T23·04+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-10-04T23·04+0200 |
commit | b6809608cc467925db44b1eb435095c37e433255 (patch) | |
tree | 65eb05089cc9c291febd85a25e917fb12f52e8ff /src/libexpr/nixexpr.hh | |
parent | 14188069692215264eb1a25d60920fac7117a2ef (diff) |
Get rid of some unnecessary ExprConcatStrings nodes in dynamic attrs
This gives a ~18% speedup in NixOS evaluation (after converting most calls to hasAttr/getAttr to dynamic attrs).
Diffstat (limited to 'src/libexpr/nixexpr.hh')
-rw-r--r-- | src/libexpr/nixexpr.hh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh index 2619a7026fca..0eaa362fd68b 100644 --- a/src/libexpr/nixexpr.hh +++ b/src/libexpr/nixexpr.hh @@ -53,16 +53,15 @@ struct Env; struct Value; class EvalState; struct StaticEnv; -struct ExprConcatStrings; /* An attribute path is a sequence of attribute names. */ struct AttrName { Symbol symbol; - ExprConcatStrings * expr; + Expr * expr; AttrName(const Symbol & s) : symbol(s) {}; - AttrName(ExprConcatStrings * e) : expr(e) {}; + AttrName(Expr * e) : expr(e) {}; }; typedef std::vector<AttrName> AttrPath; @@ -173,16 +172,17 @@ struct ExprAttrs : Expr Expr * e; Pos pos; unsigned int displ; // displacement - AttrDef(Expr * e, const Pos & pos, bool inherited=false) : inherited(inherited), e(e), pos(pos) { }; + AttrDef(Expr * e, const Pos & pos, bool inherited=false) + : inherited(inherited), e(e), pos(pos) { }; AttrDef() { }; }; typedef std::map<Symbol, AttrDef> AttrDefs; AttrDefs attrs; struct DynamicAttrDef { - ExprConcatStrings * nameExpr; - Expr * valueExpr; + Expr * nameExpr, * valueExpr; Pos pos; - DynamicAttrDef(ExprConcatStrings * nameExpr, Expr * valueExpr, const Pos & pos) : nameExpr(nameExpr), valueExpr(valueExpr), pos(pos) { }; + DynamicAttrDef(Expr * nameExpr, Expr * valueExpr, const Pos & pos) + : nameExpr(nameExpr), valueExpr(valueExpr), pos(pos) { }; }; typedef std::vector<DynamicAttrDef> DynamicAttrDefs; DynamicAttrDefs dynamicAttrs; |