Skip to contentSkip to conversation

queue: Be more specific in l_queue_insert comment

PATCH Applied Andrew Zaborowski 2 participants 2 messages Mar 2, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 queue: Be more specific in l_queue_insert comment

Specify that entries for which the compare function returns a 0 come before the new entry.

---
 ell/queue.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
ell/queue.c +3 -2
index 86c52ed..3ef892a 100644
@@ -271,8 +271,9 @@ LIB_EXPORT void *l_queue_peek_tail(struct l_queue *queue)
  * @user_data: user data given to compare function
  *
  * Inserts @data pointer at a position in the queue determined by the
- * compare @function.  @function should return > 0 if the @data (first
- * parameter) should be inserted after the current entry (second parameter).
+ * compare @function.  @function should return >= 0 if the @data (first
+ * parameter) should be inserted after the current entry (second parameter)
+ * and should return < 0 if before it.
  *
  * Returns: #true when data has been added and #false in case of failure
  **/
Signature · 1 line
2.27.0
#1 lore raw

Hi Andrew,

Quoted 6 lines · Andrew Zaborowski

Specify that entries for which the compare function returns a 0 come before the new entry.

---
  ell/queue.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

Applied, thanks.

Regards,
-Denis