diff mbox series

[v2,7/9] stash: declare ref_stash as an array

Message ID 2f03d38b36665fe258444ce58f1e138be7b97e13.1612855690.git.liu.denton@gmail.com (mailing list archive)
State Superseded
Headers show
Series stash show: learn --include-untracked and --only-untracked | expand

Commit Message

Denton Liu Feb. 9, 2021, 7:28 a.m. UTC
Save sizeof(const char *) bytes by declaring ref_stash as an array
instead of having a redundant pointer to an array.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 builtin/stash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Junio C Hamano Feb. 10, 2021, 7:28 a.m. UTC | #1
Denton Liu <liu.denton@gmail.com> writes:

> Save sizeof(const char *) bytes by declaring ref_stash as an array
> instead of having a redundant pointer to an array.
>
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
>  builtin/stash.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

OK, up to this point there is nothing new that can be controversial
in design.  I suspect that we may want to fast-track these early
clean-up steps as a separate topic rather quickly while the new
feature(s) are worked out.

Thanks.
diff mbox series

Patch

diff --git a/builtin/stash.c b/builtin/stash.c
index 9bc85f91cd..6f2b58f6ab 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -87,7 +87,7 @@  static const char * const git_stash_save_usage[] = {
 	NULL
 };
 
-static const char *ref_stash = "refs/stash";
+static const char ref_stash[] = "refs/stash";
 static struct strbuf stash_index_path = STRBUF_INIT;
 
 /*