aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-03-09 23:04:37 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-03-12 10:37:29 +0800
commitee31d5e24d92fc42c003bd49c98e674498a0dfed (patch)
tree4db78dc435bc0e16a670e6ba3584225462a5e3da /packages
parentf590aa11f79d3dfb8585b0b42103db74dcb6ee13 (diff)
downloaddexon-sol-tools-ee31d5e24d92fc42c003bd49c98e674498a0dfed.tar
dexon-sol-tools-ee31d5e24d92fc42c003bd49c98e674498a0dfed.tar.gz
dexon-sol-tools-ee31d5e24d92fc42c003bd49c98e674498a0dfed.tar.bz2
dexon-sol-tools-ee31d5e24d92fc42c003bd49c98e674498a0dfed.tar.lz
dexon-sol-tools-ee31d5e24d92fc42c003bd49c98e674498a0dfed.tar.xz
dexon-sol-tools-ee31d5e24d92fc42c003bd49c98e674498a0dfed.tar.zst
dexon-sol-tools-ee31d5e24d92fc42c003bd49c98e674498a0dfed.zip
Introduce redundant vars
Diffstat (limited to 'packages')
-rw-r--r--packages/sol-cov/src/coverage_manager.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/sol-cov/src/coverage_manager.ts b/packages/sol-cov/src/coverage_manager.ts
index 5d11800f9..c1ca7142e 100644
--- a/packages/sol-cov/src/coverage_manager.ts
+++ b/packages/sol-cov/src/coverage_manager.ts
@@ -41,7 +41,8 @@ function getSingleFileCoverageForTrace(
sourceRanges = _.uniqBy(sourceRanges, s => JSON.stringify(s)); // We don't care if one PC was covered multiple times within a single transaction
sourceRanges = _.filter(sourceRanges, sourceRange => sourceRange.fileName === fileName);
const branchCoverage: BranchCoverage = {};
- for (const branchId of _.keys(coverageEntriesDescription.branchMap)) {
+ const branchIds = _.keys(coverageEntriesDescription.branchMap);
+ for (const branchId of branchIds) {
const branchDescription = coverageEntriesDescription.branchMap[branchId];
const isCovered = _.map(branchDescription.locations, location =>
_.some(sourceRanges, range => utils.isRangeInside(range.location, location)),
@@ -49,13 +50,15 @@ function getSingleFileCoverageForTrace(
branchCoverage[branchId] = isCovered;
}
const statementCoverage: StatementCoverage = {};
- for (const statementId of _.keys(coverageEntriesDescription.statementMap)) {
+ const statementIds = _.keys(coverageEntriesDescription.statementMap);
+ for (const statementId of statementIds) {
const statementDescription = coverageEntriesDescription.statementMap[statementId];
const isCovered = _.some(sourceRanges, range => utils.isRangeInside(range.location, statementDescription));
statementCoverage[statementId] = isCovered;
}
const functionCoverage: FunctionCoverage = {};
- for (const fnId of _.keys(coverageEntriesDescription.fnMap)) {
+ const functionIds = _.keys(coverageEntriesDescription.fnMap);
+ for (const fnId of functionIds) {
const functionDescription = coverageEntriesDescription.fnMap[fnId];
const isCovered = _.some(sourceRanges, range => utils.isRangeInside(range.location, functionDescription.loc));
functionCoverage[fnId] = isCovered;