Skip to content

refactor: remove always falsy condition on perf #6547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 11, 2017
Merged

Conversation

clarkdo
Copy link
Contributor

@clarkdo clarkdo commented Sep 8, 2017

Signed-off-by: Clark Du [email protected]

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

  1. perf will never be null or undefined due to previous definition, so remove the block
  2. even if perf is null or undefined, the block will throw and Cannot read property error

@@ -46,9 +46,6 @@ var MemoryStats = function (){

var perf = window.performance || {};
// polyfill usedJSHeapSize
if (!perf && !perf.memory){
perf.memory = { usedJSHeapSize : 0 };
}
if (perf && !perf.memory){
Copy link
Contributor

Choose a reason for hiding this comment

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

perf && seems also useless.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JounQin
get it, will make some changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JounQin
done, thanks

@clarkdo clarkdo changed the title remove always falsy condition on perf refactor: remove always falsy condition on perf Sep 8, 2017
@clarkdo clarkdo force-pushed the dev branch 2 times, most recently from 0e7d14f to eaac0bf Compare September 8, 2017 07:41
@yyx990803 yyx990803 merged commit 76182a2 into vuejs:dev Sep 11, 2017
ztlevi pushed a commit to ztlevi/vue that referenced this pull request Feb 14, 2018
f2009 pushed a commit to f2009/vue that referenced this pull request Jan 25, 2019
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.

3 participants