aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-02-06 16:06:48 +0000
committergingerBill <bill@gingerbill.org>2019-02-06 16:06:48 +0000
commite1ae359a774fc343f5a3400eabf4c9b3ca5d6eb4 (patch)
tree2f2e4c50e6bb145f3718f3ddd4877b05f39f22d5 /src
parentbc5c37ebb188384d0a44b0b35aec9e01bc9104f0 (diff)
Replace redundant code
Diffstat (limited to 'src')
-rw-r--r--src/common.cpp2
-rw-r--r--src/parser.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/common.cpp b/src/common.cpp
index c85df469a..3911315f6 100644
--- a/src/common.cpp
+++ b/src/common.cpp
@@ -365,7 +365,7 @@ void arena_grow(Arena *arena, isize min_size) {
size = ALIGN_UP(size, ARENA_MIN_ALIGNMENT);
void *new_ptr = gb_alloc(arena->backing, size);
arena->ptr = cast(u8 *)new_ptr;
- gb_zero_size(arena->ptr, size);
+ // gb_zero_size(arena->ptr, size); // NOTE(bill): This should already be zeroed
GB_ASSERT(arena->ptr == ALIGN_DOWN_PTR(arena->ptr, ARENA_MIN_ALIGNMENT));
arena->end = arena->ptr + size;
array_add(&arena->blocks, arena->ptr);
diff --git a/src/parser.cpp b/src/parser.cpp
index ab5f1589c..a62bac233 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -1028,7 +1028,7 @@ Token consume_comment(AstFile *f, isize *end_line_) {
GB_ASSERT(tok.kind == Token_Comment);
isize end_line = tok.pos.line;
if (tok.string[1] == '*') {
- for (isize i = 0; i < tok.string.len; i++) {
+ for (isize i = 2; i < tok.string.len; i++) {
if (tok.string[i] == '\n') {
end_line++;
}