Skip to content

Commit 1ebee72

Browse files
authored
Merge pull request #30 from adnasa/aa-refactor-parse
refactor(parse): change approach to iteration
2 parents f0ce86b + 21675ef commit 1ebee72

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/shared/parse.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,17 @@ const updateTime = (store, componentName, phase, measure) => {
9191

9292
// Get data from the performance measures
9393
const getReactPerformanceData = measures => {
94-
let store = {}
95-
96-
for (const measure of measures) {
97-
if (getComponentAndPhaseName(measure) !== null) {
94+
const store = {}
95+
measures
96+
.filter(measure => getComponentAndPhaseName(measure) !== null)
97+
.forEach(measure => {
9898
const { componentName, phase } = getComponentAndPhaseName(measure)
9999
if (!store[componentName]) {
100100
store[componentName] = createSchema()
101101
}
102102

103103
updateTime(store, componentName, phase, measure)
104-
}
105-
}
106-
104+
})
107105
return store
108106
}
109107

0 commit comments

Comments
 (0)