]> git.ipfire.org Git - thirdparty/git.git/commit - attr.c
attr: avoid calling find_basename() twice per path
authorDuy Nguyen <pclouds@gmail.com>
Wed, 16 Jan 2013 06:02:38 +0000 (13:02 +0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Jan 2013 19:08:55 +0000 (11:08 -0800)
commit9db9eecfe5c2490d17c0d4bd5452e4cb1d0948c5
treef6dd00f2d7a013f2ae3474a635611b12388f8678
parent711536bd4ba791adfd506583927a8f6c8f821e24
attr: avoid calling find_basename() twice per path

find_basename() is only used inside collect_all_attrs(), called once
in prepare_attr_stack, then again after prepare_attr_stack()
returns. Both calls return exact same value. Reorder the code to do
the same task once. Also avoid strlen() because we knows the length
after finding basename.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
attr.c