shithub: util

Download patch

ref: 1cb7a8ce327f282796f022d51503b0a5b92786cf
parent: 783f6d8fcd85aaa04d843d3ac282b7dc238b4c2c
author: eli <eli@cloud9>
date: Mon May 13 16:17:45 EDT 2024

anagrams update

--- a/anagrams.c
+++ b/anagrams.c
@@ -76,11 +76,6 @@
 			items->children[items->nchildren] = child;
 			items->nchildren++;
 
-			if (contains(child->input, cur->word) == 0) {
-				cur = cur->next;
-				continue;
-			}
-
 			removechars(child->input, cur->word);
 			child->anagram = realloc(child->anagram, strlen(child->anagram) + strlen(cur->word) + 2);
 			sprintf(&child->anagram[strlen(child->anagram)], "%s ", cur->word);
@@ -188,11 +183,6 @@
 		items->children = realloc(items->children, (items->nchildren+1) * sizeof(item*));
 		items->children[items->nchildren] = child;
 		items->nchildren++;
-
-		if (contains(child->input, dict->word) == 0) {
-			dict = dict->next;
-			continue;
-		}
 
 		removechars(child->input, dict->word);
 		child->anagram = realloc(child->anagram, strlen(child->anagram) + strlen(dict->word) + 2);