Thread (12 messages) flat view 12 messages, 3 authors, 2016-06-15

Re: [PATCH 2/8] sha1_file: introduce has_object_file helper.

From: Duy Nguyen <hidden>
Date: 2016-06-15 23:05:14

On Tue, Jun 9, 2015 at 11:28 PM, brian m. carlson
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/sha1_file.c b/sha1_file.c
index 7e38148..09f7f03 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -3173,6 +3173,11 @@ int has_sha1_file(const unsigned char *sha1)
        return find_pack_entry(sha1, &e);
 }

+int has_object_file(const struct object_id *oid)
+{
+       return has_sha1_file(oid->hash);
+}
+
This version could be "static inline" and placed in cache.h. Though it
may be premature optimization. On top of my head I can't recall any
place where has_sha1_file() is used so many times for this extra call
to become significant overhead.
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help