summaryrefslogtreecommitdiff
path: root/src/vector.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-02-04 16:46:43 -0800
committerRussell Belfer <rb@github.com>2014-02-04 16:46:43 -0800
commit1bbacc9ff617b67831dbfce5e1b04e1bd8571aa0 (patch)
treedcc83883b0bc0223378408a79b267047930526b4 /src/vector.h
parent43709ca87811efc3c237eb719611f025502f3928 (diff)
downloadlibgit2-1bbacc9ff617b67831dbfce5e1b04e1bd8571aa0.tar.gz
Avoid extra copying in pqueue operations
This tweaks the pqueue_up and pqueue_down routines so that they will not do full element swaps but instead carry over the state of the previous loop iteration and only assign elements for which we know the final position. This will avoid a little bit of data assignment which should improve performance in theory. Also got rid of some vector helpers that I'm no longer using.
Diffstat (limited to 'src/vector.h')
-rw-r--r--src/vector.h10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/vector.h b/src/vector.h
index f983c55d5..f8256853b 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -108,14 +108,4 @@ GIT_INLINE(void) git_vector_set_cmp(git_vector *v, git_vector_cmp cmp)
}
}
-/** Swap two elements */
-#define git_vector_swap_elements(V, P1, P2) do { \
- void *__t = (V)->contents[P1]; \
- (V)->contents[P1] = (V)->contents[P2]; \
- (V)->contents[P2] = __t; } while (0)
-
-/** Compare two elements */
-#define git_vector_cmp_elements(V, P1, P2) \
- (V)->_cmp(git_vector_get(V,P1), git_vector_get(V,P2))
-
#endif