diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-09-02 14:27:54 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-09-02 14:27:54 -0700 |
commit | 33eb621b54552e5398752976f07ef9494a610841 (patch) | |
tree | ce869a8c13a9dd2274f159d499bd05b15653109e | |
parent | b758b29f5842d60933d98c1c292f00f73fedf24b (diff) | |
download | rpatricia-33eb621b54552e5398752976f07ef9494a610841.tar.gz |
sync docs with remove,match_best,match_exact behavior
match_best and match_exact will both return nil instead of false on failures, matching the documentation. remove documentation is updated to match the code, which returns true or false, never nil.
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | ext/rpatricia/rpatricia.c | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -139,7 +139,7 @@ remove: and mask specified from the Patricia Trie. If the matching node is found in the Patricia Trie, it is removed, - and this method returns the true. This method returns nil on + and this method returns the true. This method returns false on failure. remove_node: An alias of remove diff --git a/ext/rpatricia/rpatricia.c b/ext/rpatricia/rpatricia.c index 2c3fcc9..38246e1 100644 --- a/ext/rpatricia/rpatricia.c +++ b/ext/rpatricia/rpatricia.c @@ -114,7 +114,7 @@ p_match (VALUE self, VALUE r_key) node = patricia_search_best(tree, prefix); Deref_Prefix (prefix); - return node ? wrap_node(node) : Qfalse; + return node ? wrap_node(node) : Qnil; } static VALUE @@ -144,7 +144,7 @@ p_match_exact (VALUE self, VALUE r_key) node = patricia_search_exact(tree, prefix); Deref_Prefix (prefix); - return node ? wrap_node(node) : Qfalse; + return node ? wrap_node(node) : Qnil; } static VALUE |