Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Jan 30, 2018
1 parent ad1dcec commit fb46356
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/service/layers-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ function positionLt(left, top) {
}

/**
* Stores an LayoutElement's parent layer ancestry (temporarily).
* See {@link LayoutElement#ancestry}.
* Stores an LayoutElement's parent layer ancestry (temporarily), reusing the
* same array instance to avoid heavy GCs.
* See {@link LayoutElement#iterateAncestry}.
* @const {!Array<!LayoutElement>}
*/
const ANCESTRY_CACHE = [];
Expand Down Expand Up @@ -482,9 +483,6 @@ export class LayoutElement {
*/
this.scrollTop_ = 0;

/**
*
/**
* The child LayoutElements of this layer. Only a layer (which means it
* defines a coordinate system) may have children, even if the element
Expand Down Expand Up @@ -977,6 +975,7 @@ export class LayoutElement {
// Gather, and update whether the layers are descendants of the active
// layer.
let isActive = activeLayer === this || activeLayer.contains(this);
dev().assert(ANCESTRY_CACHE.length === 0, 'ancestry cache must be empty');

let layer = this;
while (layer) {
Expand Down

0 comments on commit fb46356

Please sign in to comment.