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

Optimization of Task Deletion #7450

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Chitravansh
Copy link

Problem

Need to search for the task in the list for its deletion.

Solution

Instead of finding the task by index in self.tasks and then removing it, the task can be removed directly using the index from the selection.

Changes Proposed

Instead of using self.tasks.remove(task), which searches through the list, I directly used the index to delete the task using del self.tasks[selected_index.row()].
This removes the task directly by index, avoiding the extra search operation that remove() performs.

This optimization makes the deletion process faster and simpler, especially if the list of tasks becomes long.

Other Changes

Added my name to contributor.js

@Chitravansh
Copy link
Author

@Chitravansh Please Star ⭐️ the repo to earn 'hacktober-accepted' label for the event.

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.

1 participant