From 735a197fc29b6b85a64cae5a6fa95e1209552c3b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 21 Dec 2010 15:40:04 -0600 Subject: Use name hashes in depends to avoid strcmp calls Just like we did for package name comparsions, if we add a depend name_hash field on depend struct initialization, we can use it instead of doing a string name comparison, saving us a lot of checks in the depcmp code. Signed-off-by: Dan McGee --- lib/libalpm/deps.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/deps.h') diff --git a/lib/libalpm/deps.h b/lib/libalpm/deps.h index 6fa763e1..b720b364 100644 --- a/lib/libalpm/deps.h +++ b/lib/libalpm/deps.h @@ -29,9 +29,10 @@ /* Dependency */ struct __pmdepend_t { - pmdepmod_t mod; char *name; char *version; + long name_hash; + pmdepmod_t mod; }; /* Missing dependency */ -- cgit v1.2.3-54-g00ecf