Changeset dc5c303 in mainline for common/include/adt/list.h
- Timestamp:
- 2023-12-28T13:59:23Z (14 months ago)
- Children:
- 6b66de6b
- Parents:
- 42c2e65 (diff), f87ff8e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- boba-buba <120932204+boba-buba@…> (2023-12-28 13:59:23)
- git-committer:
- GitHub <noreply@…> (2023-12-28 13:59:23)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
common/include/adt/list.h
r42c2e65 rdc5c303 183 183 * 184 184 */ 185 _NO_TRACE static inline void list_initialize(list_t *list)185 _NO_TRACE static inline __CONSTEXPR void list_initialize(list_t *list) 186 186 { 187 187 list->head.prev = &list->head; … … 332 332 _NO_TRACE static inline void headless_list_split_or_concat(link_t *part1, link_t *part2) 333 333 { 334 if (part1 == NULL || part2 == NULL) 335 return; 336 334 337 part1->prev->next = part2; 335 338 part2->prev->next = part1; … … 371 374 } 372 375 376 /** Swap the contents of two lists. 377 * 378 * @param list1 379 * @param list2 380 */ 381 static inline void list_swap(list_t *list1, list_t *list2) 382 { 383 link_t *first1 = list_first(list1); 384 link_t *first2 = list_first(list2); 385 386 /* Detach both lists from their heads. */ 387 headless_list_split(&list1->head, first1); 388 headless_list_split(&list2->head, first2); 389 390 /* Attach both lists to their new heads. */ 391 headless_list_concat(&list1->head, first2); 392 headless_list_concat(&list2->head, first1); 393 } 394 373 395 /** Concatenate two lists 374 396 *
Note:
See TracChangeset
for help on using the changeset viewer.