- add repo_id2repodata, fix loop start in maybe_load_repodata()
authorMichael Schroeder <mls@suse.de>
Fri, 23 Dec 2011 13:27:51 +0000 (14:27 +0100)
committerMichael Schroeder <mls@suse.de>
Fri, 23 Dec 2011 13:27:51 +0000 (14:27 +0100)
src/repo.h
src/repodata.c

index 52bec4a..ed52d0c 100644 (file)
@@ -74,6 +74,11 @@ static inline const char *repo_name(const Repo *repo)
   return repo->name;
 }
 
+static inline Repodata *repo_id2repodata(Repo *repo, Id id)
+{
+  return id ? repo->repodata + id : 0;
+}
+
 #define FOR_REPO_SOLVABLES(r, p, s)                                            \
   for (p = (r)->start, s = (r)->pool->solvables + p; p < (r)->end; p++, s = (r)->pool->solvables + p)  \
     if (s->repo == (r))
index 3753a26..5790f30 100644 (file)
@@ -494,7 +494,7 @@ maybe_load_repodata(Repodata *data, Id keyname)
       if (keyname)
        {
          int i;
-         for (i = 0; i < data->nkeys; i++)
+         for (i = 1; i < data->nkeys; i++)
            if (keyname == data->keys[i].name)
              break;
          if (i == data->nkeys)