@@ -181,7 +181,7 @@ static void writer_index_hash(struct reftable_writer *w, struct strbuf *hash)
181
181
struct tree_node * node = tree_search (& want , & w -> obj_index_tree ,
182
182
& obj_index_tree_node_compare , 0 );
183
183
struct obj_index_tree_node * key = NULL ;
184
- if (node == NULL ) {
184
+ if (! node ) {
185
185
struct obj_index_tree_node empty = OBJ_INDEX_TREE_NODE_INIT ;
186
186
key = reftable_malloc (sizeof (struct obj_index_tree_node ));
187
187
* key = empty ;
@@ -220,7 +220,7 @@ static int writer_add_record(struct reftable_writer *w,
220
220
221
221
strbuf_reset (& w -> last_key );
222
222
strbuf_addbuf (& w -> last_key , & key );
223
- if (w -> block_writer == NULL ) {
223
+ if (! w -> block_writer ) {
224
224
writer_reinit_block_writer (w , reftable_record_type (rec ));
225
225
}
226
226
@@ -258,7 +258,7 @@ int reftable_writer_add_ref(struct reftable_writer *w,
258
258
struct reftable_ref_record copy = * ref ;
259
259
int err = 0 ;
260
260
261
- if (ref -> refname == NULL )
261
+ if (! ref -> refname )
262
262
return REFTABLE_API_ERROR ;
263
263
if (ref -> update_index < w -> min_update_index ||
264
264
ref -> update_index > w -> max_update_index )
@@ -329,7 +329,7 @@ int reftable_writer_add_log(struct reftable_writer *w,
329
329
if (log -> value_type == REFTABLE_LOG_DELETION )
330
330
return reftable_writer_add_log_verbatim (w , log );
331
331
332
- if (log -> refname == NULL )
332
+ if (! log -> refname )
333
333
return REFTABLE_API_ERROR ;
334
334
335
335
input_log_message = log -> value .update .message ;
@@ -531,7 +531,7 @@ static int writer_finish_public_section(struct reftable_writer *w)
531
531
uint8_t typ = 0 ;
532
532
int err = 0 ;
533
533
534
- if (w -> block_writer == NULL )
534
+ if (! w -> block_writer )
535
535
return 0 ;
536
536
537
537
typ = block_writer_type (w -> block_writer );
@@ -680,7 +680,7 @@ static int writer_flush_nonempty_block(struct reftable_writer *w)
680
680
681
681
static int writer_flush_block (struct reftable_writer * w )
682
682
{
683
- if (w -> block_writer == NULL )
683
+ if (! w -> block_writer )
684
684
return 0 ;
685
685
if (w -> block_writer -> entries == 0 )
686
686
return 0 ;
0 commit comments