#23837 closed Cleanup/optimization (fixed)
Replace list.pop(0) by deque.popleft() in dfs function in migrations
| Reported by: | Zweedeend | Owned by: | Zweedeend |
|---|---|---|---|
| Component: | Migrations | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Zweedeend | Triage Stage: | Unreviewed |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
The function dfs in dj.migrations.graph uses list.pop(0) and insert(0, ...).
These methods are not efficient for lists. Using a deque with the methods popleft and extendleft is more efficient.
Change History (7)
comment:1 by , 11 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:2 by , 11 years ago
| Cc: | added |
|---|
comment:3 by , 11 years ago
| Has patch: | set |
|---|
comment:4 by , 11 years ago
comment:5 by , 11 years ago
Zweedeend, can you turn this into a proper pull request so the CI runs it?
comment:6 by , 11 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Patch at https://github.com/Zweedeend/django/tree/ticket_23837