Skip to content
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

Avoid redundant fromObject(value) calls in addObject methods #5962

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

JiwonKKang
Copy link
Contributor

Motivation:

In the addObject and addObjectAndNotify methods, the fromObject(value) function is being called redundantly. This results in unnecessary computations, which could affect performance and reduce code readability. By removing the redundant calls to fromObject(value), we can improve the efficiency and clarity of the code.

Modifications:

  • Modified the addObject method to pass the original value directly to the addObjectAndNotify method without calling fromObject(value).
  • Updated the addObjectAndNotify method to perform the fromObject(value) call once, ensuring it is not called multiple times for the same value.

Result:

  • Improved code readability and maintainability.
  • Eliminated the redundant fromObject(value) calls, enhancing performance.

@CLAassistant
Copy link

CLAassistant commented Oct 29, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

Nice catch, thanks @JiwonKKang!

Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

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

👍 👍

@jrhee17 jrhee17 added this to the 1.31.0 milestone Nov 6, 2024
Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

👍👍

@ikhoon ikhoon merged commit 93088a3 into line:main Nov 7, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants