summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f70b653)
raw | patch | inline | side by side (parent: f70b653)
author | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 15 Jan 2007 10:03:32 +0000 (05:03 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 15 Jan 2007 11:05:22 +0000 (06:05 -0500) |
There is little reason to be keeping a global duplicate_count
value when we also keep it per object type. The global counter can
easily be computed at the end, once all processing has completed.
This saves us a couple of machine instructions in an unimportant
part of code. But it looks slightly better to me to not keep
two counters around.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
value when we also keep it per object type. The global counter can
easily be computed at the end, once all processing has completed.
This saves us a couple of machine instructions in an unimportant
part of code. But it looks slightly better to me to not keep
two counters around.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
fast-import.c | patch | blob | history |
diff --git a/fast-import.c b/fast-import.c
index fc8567e9f6c23d65998a646c720a4d1523ba0048..12127168bd91355813c7c76ad9caee859f757be8 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
static unsigned long branch_count;
static unsigned long branch_load_count;
static unsigned long object_count;
-static unsigned long duplicate_count;
static unsigned long marks_set_count;
static unsigned long object_count_by_type[1 << TYPE_BITS];
static unsigned long duplicate_count_by_type[1 << TYPE_BITS];
if (mark)
insert_mark(mark, e);
if (e->offset) {
- duplicate_count++;
duplicate_count_by_type[type]++;
return 1;
}
{
int i;
unsigned long est_obj_cnt = object_entry_alloc;
- struct stat sb;
+ unsigned long duplicate_count;
setup_ident();
git_config(git_default_config);
if (branch_log)
fclose(branch_log);
+ for (i = 0; i < ARRAY_SIZE(duplicate_count_by_type); i++)
+ duplicate_count += duplicate_count_by_type[i];
+
fprintf(stderr, "%s statistics:\n", argv[0]);
fprintf(stderr, "---------------------------------------------------------------------\n");
fprintf(stderr, "Alloc'd objects: %10lu (%10lu overflow )\n", alloc_count, alloc_count - est_obj_cnt);