aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-01-14 12:33:42 +0000
committergingerBill <bill@gingerbill.org>2023-01-14 12:33:42 +0000
commit1ab90de4931f07ea61b1195de602f282a853568b (patch)
tree1e5ef6379eeefc1fed8da78948bd6d38e472bdfb /src/check_stmt.cpp
parent1064bcd0602c9ff86e2a304ecb46b8d86bb07d52 (diff)
Minimize `StringMap` structure usage
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index a2a688b13..21df1d0ea 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -626,7 +626,7 @@ gb_internal bool check_using_stmt_entity(CheckerContext *ctx, AstUsingStmt *us,
defer (rw_mutex_unlock(&scope->mutex));
for (auto const &entry : scope->elements) {
- String name = entry.key.string;
+ String name = entry.key;
Entity *decl = entry.value;
if (!is_entity_exported(decl)) continue;
@@ -1323,7 +1323,7 @@ gb_internal void check_block_stmt_for_errors(CheckerContext *ctx, Ast *body) {
ast_node(bs, BlockStmt, body);
// NOTE(bill, 2020-09-23): This logic is prevent common erros with block statements
// e.g. if cond { x := 123; } // this is an error
- if (bs->scope != nullptr && bs->scope->elements.entries.count > 0) {
+ if (bs->scope != nullptr && bs->scope->elements.count > 0) {
if (bs->scope->parent->node != nullptr) {
switch (bs->scope->parent->node->kind) {
case Ast_IfStmt: