diff --git a/lib/mess/renderer.js b/lib/mess/renderer.js index 428be29..9f5a5f2 100644 --- a/lib/mess/renderer.js +++ b/lib/mess/renderer.js @@ -225,7 +225,7 @@ mess.Renderer = function Renderer(env) { var bySymbolizer = {}; for (var i = 0; i < definitions.length; i++) { definitions[i].symbolizers().forEach(function(sym) { - var index = sym + '/' + definitions[i].selector.attachment; + var index = sym + (definitions[i].selector.attachment ? '/' + definitions[i].selector.attachment : ''); if(!bySymbolizer[index]) { bySymbolizer[index] = []; } diff --git a/lib/mess/tree/selector.js b/lib/mess/tree/selector.js index 206d7f6..108f3de 100644 --- a/lib/mess/tree/selector.js +++ b/lib/mess/tree/selector.js @@ -4,7 +4,7 @@ var assert = require('assert'); tree.Selector = function Selector(elements, filters, zoom, attachment, conditions, index) { this.elements = elements || []; - this.attachment = attachment || '__default__'; + if (attachment) this.attachment = attachment; this.filters = filters || {}; this.zoom = typeof zoom != 'undefined' ? zoom : tree.Zoom.all; this.conditions = conditions || 0; @@ -26,7 +26,7 @@ tree.Selector.prototype.debug = function() { this.index; var str = "[" + num + "] " + this.elements.join(''); - if (this.attachment !== '__default__') str += '::' + this.attachment; + if (this.attachment) str += '::' + this.attachment; str += ': Zoom[' + tree.Zoom.toString(this.zoom) + '] '; var filters = Object.keys(this.filters); filters.sort(); @@ -42,7 +42,7 @@ tree.Selector.prototype.sound = function() { tree.Selector.prototype.clone = function() { var obj = Object.create(Object.getPrototypeOf(this)); obj.elements = this.elements.slice(); - obj.attachment = this.attachment; + if (this.attachment) obj.attachment = this.attachment; obj.filters = {}; for (var id in this.filters) { obj.filters[id] = this.filters[id]; diff --git a/test/benchmark/afghanistan_votes.result b/test/benchmark/afghanistan_votes.result index 18f99e7..090f0a9 100644 --- a/test/benchmark/afghanistan_votes.result +++ b/test/benchmark/afghanistan_votes.result @@ -3,7 +3,7 @@ - - - -