Skip to content

Commit 9460055

Browse files
committed
Split grow_whatprovides_rel from pool_rel2id
1 parent ab5d8e3 commit 9460055

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

src/poolid.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ grow_whatprovides(Pool *pool, Id id)
3333
pool->whatprovides[id] = 1;
3434
}
3535

36+
static inline void
37+
grow_whatprovides_rel(Pool *pool, Id id)
38+
{
39+
if ((id & WHATPROVIDES_BLOCK) == 0)
40+
{
41+
pool->whatprovides_rel = solv_realloc2(pool->whatprovides_rel, id + (WHATPROVIDES_BLOCK + 1), sizeof(Offset));
42+
memset(pool->whatprovides_rel + id, 0, (WHATPROVIDES_BLOCK + 1) * sizeof(Offset));
43+
}
44+
}
45+
3646
/* intern string into pool, return id */
3747

3848
Id
@@ -129,11 +139,8 @@ pool_rel2id(Pool *pool, Id name, Id evr, int flags, int create)
129139
ran->flags = flags;
130140

131141
/* extend whatprovides_rel if needed */
132-
if (pool->whatprovides_rel && (id & WHATPROVIDES_BLOCK) == 0)
133-
{
134-
pool->whatprovides_rel = solv_realloc2(pool->whatprovides_rel, id + (WHATPROVIDES_BLOCK + 1), sizeof(Offset));
135-
memset(pool->whatprovides_rel + id, 0, (WHATPROVIDES_BLOCK + 1) * sizeof(Offset));
136-
}
142+
if (pool->whatprovides_rel)
143+
grow_whatprovides_rel(pool, id);
137144
return MAKERELDEP(id);
138145
}
139146

0 commit comments

Comments
 (0)