[riot-notifications] [RIOT-OS/RIOT] core/clist: add special cardinality tests and matching unittest (#16330)

Karl Fessel notifications at github.com
Thu Apr 15 11:56:34 CEST 2021


@kfessel commented on this pull request.



> + *
+ * @retval      true    If list has exactly one element
+ */
+static inline bool clist_exactly_one(clist_node_t *list)
+{
+    return !clist_is_empty(list) && (list->next == list->next->next);
+}
+
+/**
+ * @brief   Tells if a list has more than one element
+ *
+ * @note    Complexity: O(1)
+ *
+ * @param[in]   list    Pointer to the clist
+ *
+ * @returns     Cardinality > 1 information

both done

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16330#discussion_r613930568
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210415/2a7ff213/attachment.htm>


More information about the notifications mailing list