2 ms·
It's one more pointer that you have to resolve, everytime you do something with the list. Sounds smelly to me.
by majewsky 10y ago
It's one more pointer that you have to resolve, everytime you do something with the list. Sounds smelly to me.
- dpark 10y agoDepends on where you store it. If you're just passing around node pointers, then you could create the dummy node on the stack only when you need it and it's the same indirection cost as the "indirect" pointer. If you've got a "list" struct that you're passing around (pretty unlikely in C), you could embed the dummy node directly.