mu578 commented on PR #10338:
URL: https://github.com/apache/nuttx/pull/10338#issuecomment-1728723955

   > > it is ok minor wrapper to existing ; however 
`list_for_every_entry_continue` is an in-place iteration where you consume 
current list iterator and overwrite position ; don't like it much ; should 
always be caller choice to consume or not a given iterator i.e moving cursor, 
because that list pointer is not anymore deletable.
   > 
   > There is _safe version to handle the deletion(eg. list_for_every_entry and 
list_for_every_entry_safe): 
https://github.com/apache/nuttx/pull/10338/files#diff-c8b3d3e48a21d03758b14794aaba6c9d818e349a2ce2bdc873f529daf5746abfL235
 
https://github.com/apache/nuttx/pull/10338/files#diff-c8b3d3e48a21d03758b14794aaba6c9d818e349a2ce2bdc873f529daf5746abfR254
 we can provide list_for_every_entry_continue_safe later if someone want to use 
it.
   
   yes I understand, it is just the naming convention both are `safe`, maybe a 
usage comment would be welcome, if any interested, I started to puzzle more 
generic approach here ->
   
   https://github.com/mu578/mu9/tree/master/mu9/mu9_sequence
   
   ```
   - sequence
   singly; forward driven, some common maybe or duplicates will see.
   
   - circular_sequence
   singly; forward maintaining a tail end pointer O(1) push_back, first, last 
O(1).
   
   - bidirectional_sequence
   doubly; head and tail avoiding access iteration on pop, push O(1).
   ```
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to