commit 6bb255dc42e64696281bca6fc8bfb6e1437e7631 from: Stefan Sperling date: Sat Mar 17 14:12:44 2018 UTC don't dup_packidx() during cache lookup; fixes performance :) commit - 40426839c0f017c96798052f68ca5049e5c6e65a commit + 6bb255dc42e64696281bca6fc8bfb6e1437e7631 blob - e98fb7adeb67978ac794c3f495708395ab1ac809 blob + f56f6140b237ca84656c190d84578859d73bbbbe --- lib/pack.c +++ lib/pack.c @@ -404,7 +404,7 @@ search_packidx(struct got_packidx_v2_hdr **packidx, in break; *idx = get_object_idx(repo->packidx_cache[i], id); if (*idx != -1) { - *packidx = dup_packidx(repo->packidx_cache[i]); + *packidx = repo->packidx_cache[i]; if (*packidx == NULL) return got_error(GOT_ERR_NO_MEM); return NULL; @@ -891,7 +891,6 @@ resolve_ref_delta(struct got_delta_chain *deltas, stru base_offset = get_object_offset(packidx, idx); if (base_offset == (uint64_t)-1) { - got_packidx_close(packidx); return got_error(GOT_ERR_BAD_PACKIDX); } @@ -1083,7 +1082,6 @@ got_packfile_open_object(struct got_object **obj, stru return err; err = cache_pack(NULL, (*obj)->path_packfile, packidx, repo); - got_packidx_close(packidx); return err; }