Commit a3f7100
authored
⚡️ Speed up method
Here’s your optimized program.
**Explanation:**
- The **for loop did nothing** (`pass`), so it was an unnecessary O(n) iteration.
- Returning the empty list directly skips the loop entirely and is the fastest implementation possible for this code, achieving O(1) time.
- All logic is preserved (the return value is unchanged: always `[]`).
**Result:**
You won’t get faster than this for the implemented logic, as the empty list is returned instantly for any input.AlexNet._extract_features by 612%1 parent 030e1e5 commit a3f7100
1 file changed
Lines changed: 2 additions & 5 deletions
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 32 | + | |
| 33 | + | |
37 | 34 | | |
38 | 35 | | |
39 | 36 | | |
| |||
0 commit comments