From 33eb621b54552e5398752976f07ef9494a610841 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 2 Sep 2010 14:27:54 -0700 Subject: 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. --- README | 2 +- ext/rpatricia/rpatricia.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README b/README index 029599a..3b39e23 100644 --- a/README +++ b/README @@ -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 -- cgit v1.2.3-24-ge0c7