author | Marco Costalba <mcostalba@gmail.com> | |
Sat, 9 Feb 2008 14:40:19 +0000 (15:40 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 10 Feb 2008 07:57:08 +0000 (23:57 -0800) | ||
commit | c3a670de50589dedf2d9b83305e8bd0ff63a1a60 | |
tree | 303820b577a8d046a0cddddd9fbc58bd362c529d | tree | snapshot |
parent | 053d9e432be246a389fb8adaa0c88e7c791f8b21 | commit | diff |
Avoid a useless prefix lookup in strbuf_expand()
Currently, the --pretty=format prefix is looked up in a
tight loop in strbuf_expand(), if prefix is found it is then
used as argument for format_commit_item() that does another
search by a switch statement to select the proper operation.
Because the switch statement is already able to discard
unknown matches we don't need the prefix lookup before
to call format_commit_item().
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Currently, the --pretty=format prefix is looked up in a
tight loop in strbuf_expand(), if prefix is found it is then
used as argument for format_commit_item() that does another
search by a switch statement to select the proper operation.
Because the switch statement is already able to discard
unknown matches we don't need the prefix lookup before
to call format_commit_item().
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pretty.c | diff | blob | history | |
strbuf.c | diff | blob | history | |
strbuf.h | diff | blob | history |