Skip to content

Commit a4b1a0a

Browse files
committed
Merge branch 'cb/remote-ndebug-fix'
Build fix. * cb/remote-ndebug-fix: remote: avoid -Wunused-but-set-variable in gcc with -DNDEBUG
2 parents fd0d703 + 6540b71 commit a4b1a0a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

remote.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static inline void init_remotes_hash(void)
135135

136136
static struct remote *make_remote(const char *name, int len)
137137
{
138-
struct remote *ret, *replaced;
138+
struct remote *ret;
139139
struct remotes_hash_key lookup;
140140
struct hashmap_entry lookup_entry, *e;
141141

@@ -162,8 +162,8 @@ static struct remote *make_remote(const char *name, int len)
162162
remotes[remotes_nr++] = ret;
163163

164164
hashmap_entry_init(&ret->ent, lookup_entry.hash);
165-
replaced = hashmap_put_entry(&remotes_hash, ret, ent);
166-
assert(replaced == NULL); /* no previous entry overwritten */
165+
if (hashmap_put_entry(&remotes_hash, ret, ent))
166+
BUG("hashmap_put overwrote entry after hashmap_get returned NULL");
167167
return ret;
168168
}
169169

0 commit comments

Comments
 (0)