Merge pull request #543 from VladimirTechMan/master

Very minor optimization to _getCache()
This commit is contained in:
Anton Lavrenov 2019-01-17 12:33:05 -05:00 committed by GitHub
commit 9baf66113e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,10 +143,10 @@ export abstract class Node {
// if not cached, we need to set it using the private getter method. // if not cached, we need to set it using the private getter method.
if (cache === undefined) { if (cache === undefined) {
this._cache[attr] = privateGetter.call(this); this._cache[attr] = cache = privateGetter.call(this);
} }
return this._cache[attr]; return cache;
} }
/* /*
* when the logic for a cached result depends on ancestor propagation, use this * when the logic for a cached result depends on ancestor propagation, use this