You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by ji...@apache.org on 2015/03/13 16:33:14 UTC

svn commit: r1666483 - /apr/apr/branches/1.5.x/include/apr_skiplist.h

Author: jim
Date: Fri Mar 13 15:33:14 2015
New Revision: 1666483

URL: http://svn.apache.org/r1666483
Log:
Describe the comp functions

Modified:
    apr/apr/branches/1.5.x/include/apr_skiplist.h

Modified: apr/apr/branches/1.5.x/include/apr_skiplist.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/include/apr_skiplist.h?rev=1666483&r1=1666482&r2=1666483&view=diff
==============================================================================
--- apr/apr/branches/1.5.x/include/apr_skiplist.h (original)
+++ apr/apr/branches/1.5.x/include/apr_skiplist.h Fri Mar 13 15:33:14 2015
@@ -40,7 +40,9 @@ extern "C" {
 /**
  * apr_skiplist_compare is the function type that must be implemented 
  * per object type that is used in a skip list for comparisons to maintain
- * order
+ * order. A value <0 indicates placement after this node; a value of 0
+ * indicates collision with this exact node; a value >0 indicates placement
+ * before this node.
  * */
 typedef int (*apr_skiplist_compare) (void *, void *);
 
@@ -182,7 +184,7 @@ APR_DECLARE(apr_skiplistnode *) apr_skip
 
 /**
  * Insert an element into the skip list using the existing comparison function
- * if it does not already exist.
+ * if it does not already exist (as determined by the comparison function)
  * @param sl The skip list
  * @param data The element to insert
  * @remark If no comparison function has been set for the skip list, the element



Re: svn commit: r1666483 - /apr/apr/branches/1.5.x/include/apr_skiplist.h

Posted by Yann Ylavic <yl...@gmail.com>.
On Fri, Mar 13, 2015 at 4:33 PM,  <ji...@apache.org> wrote:
> Author: jim
> Date: Fri Mar 13 15:33:14 2015
> New Revision: 1666483
>
> URL: http://svn.apache.org/r1666483
> Log:
> Describe the comp functions
>
> Modified:
>     apr/apr/branches/1.5.x/include/apr_skiplist.h
>
> Modified: apr/apr/branches/1.5.x/include/apr_skiplist.h
> URL: http://svn.apache.org/viewvc/apr/apr/branches/1.5.x/include/apr_skiplist.h?rev=1666483&r1=1666482&r2=1666483&view=diff
> ==============================================================================
> --- apr/apr/branches/1.5.x/include/apr_skiplist.h (original)
> +++ apr/apr/branches/1.5.x/include/apr_skiplist.h Fri Mar 13 15:33:14 2015
> @@ -40,7 +40,9 @@ extern "C" {
>  /**
>   * apr_skiplist_compare is the function type that must be implemented
>   * per object type that is used in a skip list for comparisons to maintain
> - * order
> + * order. A value <0 indicates placement after this node; a value of 0
> + * indicates collision with this exact node; a value >0 indicates placement
> + * before this node.
>   * */

Isn't it rather <0 => before and >0 => after?
>0 goes next (after) whereas <0 goes down (stacking next nodes which will then be chained after the new node).