diff options
author | pommicket <pommicket@gmail.com> | 2023-01-01 23:35:55 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-01-01 23:35:55 -0500 |
commit | 94b241351c7418c2f6a32cc01b889bc48478c50d (patch) | |
tree | 6647c7428c82fe2cd8290fc94983e5934ca1b4e2 | |
parent | 4a8dcb2db975a3681ff63518a20ca8afc3137782 (diff) |
replace @OPTIMIZE with @TODO
-rw-r--r-- | buffer.c | 11 | ||||
-rw-r--r-- | colors.c | 2 | ||||
-rw-r--r-- | command.c | 2 | ||||
-rw-r--r-- | config.c | 2 | ||||
-rw-r--r-- | main.c | 1 |
5 files changed, 9 insertions, 9 deletions
@@ -661,8 +661,8 @@ static Status buffer_edit_resize_prev_text(TextBuffer *buffer, BufferEdit *edit, // does this edit actually make a difference to the buffer? static bool buffer_edit_does_anything(TextBuffer *buffer, BufferEdit *edit) { if (edit->prev_len == edit->new_len) { - // @OPTIMIZE: compare directly to the buffer contents, rather than extracting them temporarily - // into new_text. + // @TODO(optimization): compare directly to the buffer contents, + // rather than extracting them temporarily into new_text. char32_t *new_text = buffer_calloc(buffer, edit->new_len, sizeof *new_text); if (new_text) { size_t len = buffer_get_text_at_pos(buffer, edit->pos, new_text, edit->new_len); @@ -1747,13 +1747,13 @@ void buffer_select_page_down(TextBuffer *buffer, i64 npages) { static void buffer_shorten_line(Line *line, u32 new_len) { assert(line->len >= new_len); - line->len = new_len; // @OPTIMIZE(memory): decrease line capacity + line->len = new_len; // @TODO(optimization,memory): decrease line capacity } // decrease the number of lines in the buffer. // DOES NOT DO ANYTHING TO THE LINES REMOVED! YOU NEED TO FREE THEM YOURSELF! static void buffer_shorten(TextBuffer *buffer, u32 new_nlines) { - buffer->nlines = new_nlines; // @OPTIMIZE(memory): decrease lines capacity + buffer->nlines = new_nlines; // @TODO(optimization,memory): decrease lines capacity } // delete `nlines` lines starting from index `first_line_idx` @@ -2002,7 +2002,8 @@ void buffer_newline(TextBuffer *buffer) { } if (settings->auto_indent) { // newline + auto-indent - char32_t *text = buffer_calloc(buffer, whitespace_len + 1, sizeof *text); // @OPTIMIZE: don't allocate on heap if whitespace_len is small + // @TODO(optimize): don't allocate on heap if whitespace_len is small + char32_t *text = buffer_calloc(buffer, whitespace_len + 1, sizeof *text); if (text) { text[0] = '\n'; memcpy(&text[1], line.str, whitespace_len * sizeof *text); @@ -58,7 +58,7 @@ static ColorName const color_names[] = { static_assert_if_possible(arr_count(color_names) == COLOR_COUNT) ColorSetting color_setting_from_str(const char *str) { - // @OPTIMIZE: sort color_names, binary search + // @TODO(optimize): sort color_names, binary search for (int i = 0; i < COLOR_COUNT; ++i) { ColorName const *n = &color_names[i]; if (streq(n->name, str)) @@ -88,7 +88,7 @@ static CommandName const command_names[] = { static_assert_if_possible(arr_count(command_names) == CMD_COUNT) Command command_from_str(char const *str) { - // @OPTIMIZE: sort command_names, do a binary search + // @TODO(optimize): sort command_names, do a binary search for (int i = 0; i < CMD_COUNT; ++i) { if (streq(command_names[i].name, str)) return command_names[i].cmd; @@ -292,7 +292,7 @@ static u32 config_parse_key_combo(ConfigReader *cfg, char const *str) { {"X2", "x2", SCANCODE_MOUSE_X2, 0} }; - // @OPTIMIZE: sort key_names (and split keyname1/2); do a binary search + // @TODO(optimize): sort key_names (and split keyname1/2); do a binary search for (size_t i = 0; i < arr_count(key_names); ++i) { KeyName const *k = &key_names[i]; if (streq(str, k->keyname1) || (k->keyname2 && streq(str, k->keyname2))) { @@ -1,6 +1,5 @@ /* @TODO: -- change @OPTIM(IZE) to @TODO - rename v[234] to vec[234] - handle multiple symbols with same name in go-to-definition menu - better non-error window/showMessage(Request) |