Skip to content

Commit

Permalink
ewah: delete unused 'rlwit_discharge_empty()'
Browse files Browse the repository at this point in the history
Complete the removal of unused 'ewah bitmap' code by removing the now
unused 'rlwit_discharge_empty()' function. Also, the 'ewah_clear()'
function can now be made a file-scope static symbol.

Signed-off-by: Ramsay Jones <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
gitster committed Jun 21, 2018
1 parent 2667508 commit c806278
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 23 deletions.
20 changes: 12 additions & 8 deletions ewah/ewah_bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,18 @@ void ewah_each_bit(struct ewah_bitmap *self, void (*callback)(size_t, void*), vo
}
}

/**
* Clear all the bits in the bitmap. Does not free or resize
* memory.
*/
static void ewah_clear(struct ewah_bitmap *self)
{
self->buffer_size = 1;
self->buffer[0] = 0;
self->bit_size = 0;
self->rlw = self->buffer;
}

struct ewah_bitmap *ewah_new(void)
{
struct ewah_bitmap *self;
Expand All @@ -288,14 +300,6 @@ struct ewah_bitmap *ewah_new(void)
return self;
}

void ewah_clear(struct ewah_bitmap *self)
{
self->buffer_size = 1;
self->buffer[0] = 0;
self->bit_size = 0;
self->rlw = self->buffer;
}

void ewah_free(struct ewah_bitmap *self)
{
if (!self)
Expand Down
8 changes: 0 additions & 8 deletions ewah/ewah_rlw.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,3 @@ size_t rlwit_discharge(

return index;
}

void rlwit_discharge_empty(struct rlw_iterator *it, struct ewah_bitmap *out)
{
while (rlwit_word_size(it) > 0) {
ewah_add_empty_words(out, 0, rlwit_word_size(it));
rlwit_discard_first_words(it, rlwit_word_size(it));
}
}
6 changes: 0 additions & 6 deletions ewah/ewok.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ void ewah_pool_free(struct ewah_bitmap *self);
*/
struct ewah_bitmap *ewah_new(void);

/**
* Clear all the bits in the bitmap. Does not free or resize
* memory.
*/
void ewah_clear(struct ewah_bitmap *self);

/**
* Free all the memory of the bitmap
*/
Expand Down
1 change: 0 additions & 1 deletion ewah/ewok_rlw.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ void rlwit_init(struct rlw_iterator *it, struct ewah_bitmap *bitmap);
void rlwit_discard_first_words(struct rlw_iterator *it, size_t x);
size_t rlwit_discharge(
struct rlw_iterator *it, struct ewah_bitmap *out, size_t max, int negate);
void rlwit_discharge_empty(struct rlw_iterator *it, struct ewah_bitmap *out);

static inline size_t rlwit_word_size(struct rlw_iterator *it)
{
Expand Down

0 comments on commit c806278

Please sign in to comment.