You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2014/07/04 23:11:09 UTC

[04/10] git commit: refs/heads/master - Eliminate NoCloneHash; use a plain Hash instead.

Eliminate NoCloneHash; use a plain Hash instead.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/987b5c72
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/987b5c72
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/987b5c72

Branch: refs/heads/master
Commit: 987b5c72da2401f464126f700a1bf3ba57c732c0
Parents: 5c0d6d9
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Jul 1 16:42:16 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Fri Jul 4 14:10:06 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Analysis/SnowballStopFilter.c   | 24 ++----------------------
 core/Lucy/Analysis/SnowballStopFilter.cfh | 11 -----------
 2 files changed, 2 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/987b5c72/core/Lucy/Analysis/SnowballStopFilter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Analysis/SnowballStopFilter.c b/core/Lucy/Analysis/SnowballStopFilter.c
index efae12d..4e4c998 100644
--- a/core/Lucy/Analysis/SnowballStopFilter.c
+++ b/core/Lucy/Analysis/SnowballStopFilter.c
@@ -141,33 +141,13 @@ SnowStop_gen_stoplist(String *language) {
     }
     size_t num_stopwords = 0;
     for (uint32_t i = 0; words[i] != NULL; i++) { num_stopwords++; }
-    NoCloneHash *stoplist = NoCloneHash_new(num_stopwords);
+    Hash *stoplist = Hash_new(num_stopwords);
     for (uint32_t i = 0; words[i] != NULL; i++) {
         char *word = (char*)words[i];
         String *stop = Str_new_wrap_trusted_utf8(word, strlen(word));
-        NoCloneHash_Store(stoplist, (Obj*)stop, (Obj*)Str_newf(""));
+        Hash_Store(stoplist, (Obj*)stop, (Obj*)CFISH_TRUE);
         DECREF(stop);
     }
     return (Hash*)stoplist;
 }
 
-/***************************************************************************/
-
-NoCloneHash*
-NoCloneHash_new(uint32_t capacity) {
-    NoCloneHash *self = (NoCloneHash*)VTable_Make_Obj(NOCLONEHASH);
-    return NoCloneHash_init(self, capacity);
-}
-
-NoCloneHash*
-NoCloneHash_init(NoCloneHash *self, uint32_t capacity) {
-    return (NoCloneHash*)Hash_init((Hash*)self, capacity);
-}
-
-Obj*
-NoCloneHash_Make_Key_IMP(NoCloneHash *self, Obj *key, int32_t hash_sum) {
-    UNUSED_VAR(self);
-    UNUSED_VAR(hash_sum);
-    return INCREF(key);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/987b5c72/core/Lucy/Analysis/SnowballStopFilter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Analysis/SnowballStopFilter.cfh b/core/Lucy/Analysis/SnowballStopFilter.cfh
index 6d9f3dc..8dc9b28 100644
--- a/core/Lucy/Analysis/SnowballStopFilter.cfh
+++ b/core/Lucy/Analysis/SnowballStopFilter.cfh
@@ -105,14 +105,3 @@ public class Lucy::Analysis::SnowballStopFilter nickname SnowStop
     Destroy(SnowballStopFilter *self);
 }
 
-class Lucy::Analysis::SnowballStopFilter::NoCloneHash inherits Clownfish::Hash {
-    inert incremented NoCloneHash*
-    new(uint32_t capacity = 0);
-
-    inert NoCloneHash*
-    init(NoCloneHash *self, uint32_t capacity = 0);
-
-    public incremented Obj*
-    Make_Key(NoCloneHash *self, Obj *key, int32_t hash_sum);
-}
-