You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2013/07/01 20:48:07 UTC

[lucy-commits] [2/4] git commit: refs/heads/master - Use class name to check for fresh symbols

Use class name to check for fresh symbols

Checking by cnick isn't safe with multiple parcels.


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

Branch: refs/heads/master
Commit: 2198b8b091906c6ac92d9b806468d4a1bbdf58dd
Parents: 23857d2
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Jul 1 00:52:31 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Mon Jul 1 20:41:33 2013 +0200

----------------------------------------------------------------------
 clownfish/compiler/src/CFCClass.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/2198b8b0/clownfish/compiler/src/CFCClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCClass.c b/clownfish/compiler/src/CFCClass.c
index 0eda731..a84c5f6 100644
--- a/clownfish/compiler/src/CFCClass.c
+++ b/clownfish/compiler/src/CFCClass.c
@@ -467,12 +467,11 @@ CFCClass_method(CFCClass *self, const char *sym) {
 
 CFCMethod*
 CFCClass_fresh_method(CFCClass *self, const char *sym) {
-    // TODO: Comparing classes by cnick isn't safe with multiple parcels.
     CFCMethod *method = CFCClass_method(self, sym);
     if (method) {
-        const char *cnick = CFCClass_get_cnick(self);
-        const char *meth_cnick = CFCMethod_get_class_cnick(method);
-        if (strcmp(cnick, meth_cnick) == 0) {
+        const char *class_name = CFCClass_get_class_name(self);
+        const char *meth_class_name = CFCMethod_get_class_name(method);
+        if (strcmp(class_name, meth_class_name) == 0) {
             return method;
         }
     }
@@ -655,8 +654,7 @@ CFCClass_tree_to_ladder(CFCClass *self) {
 
 static CFCSymbol**
 S_fresh_syms(CFCClass *self, CFCSymbol **syms) {
-    // TODO: Comparing classes by cnick isn't safe with multiple parcels.
-    const char *cnick = CFCClass_get_cnick(self);
+    const char *class_name = CFCClass_get_class_name(self);
     size_t count = 0;
     while (syms[count] != NULL) { count++; }
     size_t amount = (count + 1) * sizeof(CFCSymbol*);
@@ -664,8 +662,8 @@ S_fresh_syms(CFCClass *self, CFCSymbol **syms) {
     size_t num_fresh = 0;
     for (size_t i = 0; i < count; i++) {
         CFCSymbol *sym = syms[i];
-        const char *sym_cnick = CFCSymbol_get_class_cnick(sym);
-        if (strcmp(sym_cnick, cnick) == 0) {
+        const char *sym_class_name = CFCSymbol_get_class_name(sym);
+        if (strcmp(sym_class_name, class_name) == 0) {
             fresh[num_fresh++] = sym;
         }
     }