Merge branch 'tg/ce-namelen'
authorJunio C Hamano <gitster@pobox.com>
Fri, 13 Jul 2012 22:37:58 +0000 (15:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Jul 2012 22:37:58 +0000 (15:37 -0700)
Trivially correct clean-up and micro optimization.

* tg/ce-namelen:
Replace strlen() with ce_namelen()

read-cache.c
unpack-trees.c
index ef355cc9a89b948688756b8c3681ac607518492b..1df6adf0bf786d7428d42973b3e7bc41870ff702 100644 (file)
@@ -1119,7 +1119,7 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p
                        continue;
 
                if (pathspec &&
-                   !match_pathspec(pathspec, ce->name, strlen(ce->name), 0, seen))
+                   !match_pathspec(pathspec, ce->name, ce_namelen(ce), 0, seen))
                        filtered = 1;
 
                if (ce_stage(ce)) {
@@ -1841,7 +1841,7 @@ int read_index_unmerged(struct index_state *istate)
                if (!ce_stage(ce))
                        continue;
                unmerged = 1;
-               len = strlen(ce->name);
+               len = ce_namelen(ce);
                size = cache_entry_size(len);
                new_ce = xcalloc(1, size);
                memcpy(new_ce->name, ce->name, len);
index 33a581924e11167dc546bdf97c8d49460b43674e..29893bf65978d4ea14f669851ca37d2df445b503 100644 (file)
@@ -1296,7 +1296,7 @@ static int verify_clean_subdirectory(struct cache_entry *ce,
         * First let's make sure we do not have a local modification
         * in that directory.
         */
-       namelen = strlen(ce->name);
+       namelen = ce_namelen(ce);
        for (i = locate_in_src_index(ce, o);
             i < o->src_index->cache_nr;
             i++) {