Skip to content

Commit

Permalink
[compiler] remove useless variables
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Nov 30, 2011
1 parent c00f39a commit 576fe23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
5 changes: 1 addition & 4 deletions lib/xjst/compiler.js
Expand Up @@ -415,10 +415,7 @@ exports.generate = function generate(ast, options) {
var engine = xjst.engines[options.engine] ||
xjst.engines[process.env.XJST_ENGINE] ||
xjst.engines.fullgen,
tree = optimizeRecursion(engine(
templates, options,
predicateValues, predicateMap
));
tree = optimizeRecursion(engine(templates, options, predicateValues));

// Finally render tree
body = [
Expand Down
11 changes: 4 additions & 7 deletions lib/xjst/engines/fullgen.js
Expand Up @@ -59,17 +59,14 @@ Merger.prototype.merge = function merge(obj) {
};

//
// ### function engine (templates, options, predicateMap)
// ### function engine (templates, options, values)
// #### @templates {Array} AST
// #### @options {Object} Compiler options
// #### @values {Object} Hash map of values of each each predicate
// #### @map {Object} Map: predicate id => predicate AST
// Returns optimized tree (via fullgen algorithm)
//
module.exports = function engine(templates, options, values, map) {
var predicatesValues = values,
predicateMap = map,
merger = new Merger(),
module.exports = function engine(templates, options, values) {
var merger = new Merger(),
merge = merger.merge.bind(merger),
unique = new utils.Identifier();

Expand Down Expand Up @@ -134,7 +131,7 @@ module.exports = function engine(templates, options, values, map) {
var result = {};

result['switch'] = subMatch[1];
result.cases = predicatesValues[subMatch[0]].map(function(v) {
result.cases = values[subMatch[0]].map(function(v) {
return [v, traverse(i, j,
xjst.state.create(state, predicate,
utils.stringify(v)))];
Expand Down

0 comments on commit 576fe23

Please sign in to comment.