summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-10-23 18:56:53 +0200
committerMichael Schroeder <mls@suse.de>2012-10-23 18:56:53 +0200
commitc22885effecc6c60d5f7011db2822af4d1ef6426 (patch)
treed3945e5761a01c607e8813dcec3b4df448ae63c9
parent23b8cd43398b236f4a6b31b2103abf709cdc7f19 (diff)
downloadlibsolv-c22885effecc6c60d5f7011db2822af4d1ef6426.tar.gz
libsolv-c22885effecc6c60d5f7011db2822af4d1ef6426.tar.bz2
libsolv-c22885effecc6c60d5f7011db2822af4d1ef6426.zip
help gcc inliner a bit
-rw-r--r--src/repodata.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/repodata.c b/src/repodata.c
index d2e56f2..d64a00b 100644
--- a/src/repodata.c
+++ b/src/repodata.c
@@ -682,22 +682,28 @@ repodata_lookup_num(Repodata *data, Id solvid, Id keyname, unsigned long long *v
{
unsigned char *dp;
Repokey *key;
- KeyValue kv;
+ unsigned int high, low;
*value = 0;
dp = find_key_data(data, solvid, keyname, &key);
if (!dp)
return 0;
- if (key->type == REPOKEY_TYPE_NUM
- || key->type == REPOKEY_TYPE_U32
- || key->type == REPOKEY_TYPE_CONSTANT)
+ switch (key->type)
{
- kv.num = kv.num2 = 0;
- dp = data_fetch(dp, &kv, key);
- *value = SOLV_KV_NUM64(&kv);
+ case REPOKEY_TYPE_NUM:
+ data_read_num64(dp, &low, &high);
+ *value = (unsigned long long)high << 32 | low;
return 1;
+ case REPOKEY_TYPE_U32:
+ data_read_u32(dp, &low);
+ *value = low;
+ return 1;
+ case REPOKEY_TYPE_CONSTANT:
+ *value = key->size;
+ return 1;
+ default:
+ return 0;
}
- return 0;
}
int