ref: 505618290f159d5453d2e86abdb8f4297e846f74
parent: 14fd8b9e92ffe32275aba6f30dd8edf4531c6a19
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Dec 25 15:24:57 EST 2015
Fix unused variable warning.
--- a/parse/use.c
+++ b/parse/use.c
@@ -815,13 +815,14 @@
static void protomap(Trait *tr, Type *ty, Node *dcl)
{
size_t i, len;
- char *protoname, *dclname;
+ char *protoname, *dclname, *p;
dclname = declname(dcl);
for (i = 0; i < tr->nfuncs; i++) {
protoname = declname(tr->funcs[i]);
len = strlen(protoname);
- if (strstr(dclname, protoname))
+ p = strstr(dclname, protoname);
+ if (p && p[len] == '$')
htput(tr->funcs[i]->decl.impls, ty, dcl);
}
}