Commit 6134dee
authored
add early exit to
- seems odd to perform work on a node that could potentially be a nullptr from the moment the function is called (regardless of CAS)
- same thing applies to `void pop(T &val)` (early exit allows the code the run without throwing for bad access to `old_head->next`).pop()
1 parent 6e7ae1d commit 6134dee
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
0 commit comments