Skip to content

Slightly simplify the implementation of the draw log in the canvas mock#4436

Merged
julienw merged 2 commits into
firefox-devtools:mainfrom
julienw:simplify-mock-canvas-context
Jan 20, 2023
Merged

Slightly simplify the implementation of the draw log in the canvas mock#4436
julienw merged 2 commits into
firefox-devtools:mainfrom
julienw:simplify-mock-canvas-context

Conversation

@julienw

@julienw julienw commented Jan 20, 2023

Copy link
Copy Markdown
Contributor

This is a very simple change that I've made while working on something else. This should bring no visible change to tests, and maybe make them slightly faster.

const oldLog = log.slice();
log.splice(0, log.length);
return oldLog;
return log.splice(0, log.length);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

splice returns the deleted elements

@julienw julienw requested a review from canova January 20, 2023 11:57
@codecov

codecov Bot commented Jan 20, 2023

Copy link
Copy Markdown

Codecov Report

Base: 88.55% // Head: 88.52% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (e5e55d8) compared to base (dacf247).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head e5e55d8 differs from pull request most recent head d6fab69. Consider uploading reports for the commit d6fab69 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4436      +/-   ##
==========================================
- Coverage   88.55%   88.52%   -0.03%     
==========================================
  Files         283      283              
  Lines       25535    25506      -29     
  Branches     6879     6869      -10     
==========================================
- Hits        22613    22580      -33     
- Misses       2715     2717       +2     
- Partials      207      209       +2     
Impacted Files Coverage Δ
src/test/fixtures/mocks/canvas-context.js 88.46% <100.00%> (-0.43%) ⬇️
src/components/flame-graph/FlameGraph.js 74.50% <0.00%> (-3.93%) ⬇️
src/components/stack-chart/index.js 85.71% <0.00%> (-1.18%) ⬇️
src/components/shared/CallNodeContextMenu.js 89.51% <0.00%> (-0.73%) ⬇️
src/components/shared/TreeView.js 82.44% <0.00%> (-0.17%) ⬇️
src/components/shared/VirtualList.js 93.22% <0.00%> (-0.12%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@canova canova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice simplification!

@julienw julienw enabled auto-merge (squash) January 20, 2023 13:34
@julienw julienw merged commit f19b68a into firefox-devtools:main Jan 20, 2023
@canova canova mentioned this pull request Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants