You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (inti=0; i<tablelen; i++) SET_TRUELENGTH(td[i], 0);
105
-
savetl_end();
106
84
error(_("Failed to allocate %"PRIu64" bytes working memory in chmatchdup: length(table)=%d length(unique(table))=%d"), ((uint64_t)tablelen*2+nuniq)*sizeof(int), tablelen, nuniq);
107
85
// # nocov end
108
86
}
109
-
for (inti=0; i<tablelen; ++i) counts[-TRUELENGTH(td[i])-1]++;
87
+
for (inti=0; i<tablelen; ++i) counts[-hash_lookup(marks, td[i], 0)-1]++;
110
88
for (inti=0, sum=0; i<nuniq; ++i) { inttt=counts[i]; counts[i]=sum; sum+=tt+1; }
111
-
for (inti=0; i<tablelen; ++i) map[counts[-TRUELENGTH(td[i])-1]++] =i+1; // 0 is left ending each group thanks to the calloc
89
+
for (inti=0; i<tablelen; ++i) map[counts[-hash_lookup(marks, td[i], 0)-1]++] =i+1; // 0 is left ending each group thanks to the calloc
112
90
for (inti=0, last=0; i<nuniq; ++i) {inttt=counts[i]+1; counts[i]=last; last=tt;} // rewind counts to the beginning of each group
113
91
for (inti=0; i<xlen; ++i) {
114
-
intu=TRUELENGTH(xd[i]);
92
+
intu=hash_lookup(marks, xd[i], 0);
115
93
if (u<0) {
116
94
constintw=counts[-u-1]++;
117
95
if (map[w]) { ansd[i]=map[w]; continue; }
118
-
SET_TRUELENGTH(xd[i],0); // w falls on ending 0 marker: dups used up; any more dups should return nomatch
96
+
hash_set(marks,xd[i],0); // w falls on ending 0 marker: dups used up; any more dups should return nomatch
119
97
// we still need the 0-setting loop at the end of this function because often there will be some values in table that are not matched to at all.
0 commit comments