diff options
author | Michael Forney <mforney@mforney.org> | 2019-04-17 20:03:44 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-04-17 20:11:06 -0700 |
commit | d02201ec74d5d6f54bf1980317be45e1e5aef21c (patch) | |
tree | 3b3af604f747e168f674964ed3a7d90981f5faf2 /scope.c | |
parent | f4d1b8acc04c4f2beeffafa8ff1cca0bdfbe71b2 (diff) |
Just use a single mapkey function
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -70,7 +70,7 @@ scopegetdecl(struct scope *s, const char *name, bool recurse) struct decl *d; struct mapkey k; - mapstrkey(&k, name); + mapkey(&k, name, strlen(name)); do { d = s->decls ? mapget(s->decls, &k) : NULL; s = s->parent; @@ -85,7 +85,7 @@ scopegettag(struct scope *s, const char *name, bool recurse) struct type *t; struct mapkey k; - mapstrkey(&k, name); + mapkey(&k, name, strlen(name)); do { t = s->tags ? mapget(s->tags, &k) : NULL; s = s->parent; @@ -101,7 +101,7 @@ scopeputdecl(struct scope *s, const char *name, struct decl *d) if (!s->decls) s->decls = mkmap(32); - mapstrkey(&k, name); + mapkey(&k, name, strlen(name)); *mapput(s->decls, &k) = d; } @@ -112,6 +112,6 @@ scopeputtag(struct scope *s, const char *name, struct type *t) if (!s->tags) s->tags = mkmap(32); - mapstrkey(&k, name); + mapkey(&k, name, strlen(name)); *mapput(s->tags, &k) = t; } |