Browse Source

Replace redundant code

gingerBill 6 years ago
parent
commit
e1ae359a77
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/common.cpp
  2. 1 1
      src/parser.cpp

+ 1 - 1
src/common.cpp

@@ -365,7 +365,7 @@ void arena_grow(Arena *arena, isize min_size) {
 	size = ALIGN_UP(size, ARENA_MIN_ALIGNMENT);
 	size = ALIGN_UP(size, ARENA_MIN_ALIGNMENT);
 	void *new_ptr = gb_alloc(arena->backing, size);
 	void *new_ptr = gb_alloc(arena->backing, size);
 	arena->ptr = cast(u8 *)new_ptr;
 	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));
 	GB_ASSERT(arena->ptr == ALIGN_DOWN_PTR(arena->ptr, ARENA_MIN_ALIGNMENT));
 	arena->end = arena->ptr + size;
 	arena->end = arena->ptr + size;
 	array_add(&arena->blocks, arena->ptr);
 	array_add(&arena->blocks, arena->ptr);

+ 1 - 1
src/parser.cpp

@@ -1028,7 +1028,7 @@ Token consume_comment(AstFile *f, isize *end_line_) {
 	GB_ASSERT(tok.kind == Token_Comment);
 	GB_ASSERT(tok.kind == Token_Comment);
 	isize end_line = tok.pos.line;
 	isize end_line = tok.pos.line;
 	if (tok.string[1] == '*') {
 	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') {
 			if (tok.string[i] == '\n') {
 				end_line++;
 				end_line++;
 			}
 			}