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

Improve efficiency of saving and deleting issue models #193

Merged
merged 8 commits into from
Sep 26, 2023

Conversation

seetohjinwei
Copy link
Contributor

Summary:

Fixes #188

Type of change:

  • ✨ New Feature/ Enhancement
  • 🎨 Code Refactoring

Changes Made:

  • Remove duplicate usage of createIssueModel
  • Change updateLocalStore to take in an array of issues to avoid having to do O(n) loops for each issue
  • Change deleteIssuesFromLocalStore to directly update this.issues using delete keyword, remove currently unused deleteFromLocalStore

Screenshots:

N/A

Proposed Commit Message:

Improve efficiency of saving and deleting issue models

Previously, saving and deleting issues took up to O(n^2).

Let's
* Remove unnecessary loops to achieve O(n).

Checklist:

  • I have tested my changes thoroughly.
  • I have created tests for any new code files created in this PR or provided a link to a issue/PR that addresses this.
  • I have added or modified code comments to improve code readability where necessary.
  • I have updated the project's documentation as necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for your PR! Nicely done 🔥

Changes are working well, so far LGTM 🚀 🚀 other than the small comments to resolve!

src/app/core/services/issue.service.ts Show resolved Hide resolved
src/app/core/services/issue.service.ts Outdated Show resolved Hide resolved
src/app/core/services/issue.service.ts Outdated Show resolved Hide resolved
src/app/core/services/issue.service.ts Outdated Show resolved Hide resolved
src/app/core/services/issue.service.ts Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

Approved :)

@chunweii chunweii merged commit 404dd33 into CATcher-org:main Sep 26, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inefficient saving of Issues and PRs
5 participants