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)
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>
No differences found