Skip to content

Commit

Permalink
remove metadata_conf_filename from index
Browse files Browse the repository at this point in the history
  • Loading branch information
sspathare97 committed Nov 24, 2022
1 parent a5cb7ea commit 275a824
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
8 changes: 0 additions & 8 deletions src/metadata_index.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ struct metadata_index *metadata_index_new() {
err(1, "malloc failure for metadata_index in metadata_index_new.\n");
}

metadata_index->metadata_conf_filename = NULL;
metadata_index->columns = NULL;
metadata_index->metadata_index_filename = NULL;
metadata_index->metadata_index_fp = NULL;
Expand Down Expand Up @@ -528,7 +527,6 @@ struct metadata_index *metadata_index_init(char *metadata_conf_filename, char *m
}

struct metadata_index *metadata_index = metadata_index_new();
metadata_index->metadata_conf_filename = strdup(metadata_conf_filename);
metadata_index->metadata_index_filename = strdup(metadata_index_filename);

metadata_index->num_rows = 0;
Expand Down Expand Up @@ -589,9 +587,6 @@ struct metadata_index *metadata_index_load(char *metadata_index_filename) {
struct metadata_index *metadata_index = metadata_index_new();
metadata_index->metadata_index_filename = strdup(metadata_index_filename);

metadata_index->metadata_conf_filename = NULL;
metadata_index->columns = NULL;

FILE *metadata_index_fp = fopen(metadata_index_filename, "rb");
if (metadata_index_fp == NULL) {
err(1, "%s not found.\n", metadata_index_filename);
Expand Down Expand Up @@ -760,11 +755,8 @@ void metadata_index_destroy(struct metadata_index **metadata_index_ptr) {
struct metadata_index *metadata_index = *metadata_index_ptr;
int i;

// members used only for operations used in indexing- init, add
free(metadata_index->metadata_conf_filename);
free(metadata_index->columns);

// other members, always used
free(metadata_index->metadata_index_filename);

for (i = 0; i < metadata_index->num_cols; ++i) {
Expand Down
7 changes: 3 additions & 4 deletions src/metadata_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,10 @@ struct metadata_rows {
};

struct metadata_index {
// members used only for operations used in indexing- init, add
char *metadata_conf_filename;
uint8_t *columns; // column numbers in the conf file
// for storing the column numbers in the conf file,
// only used by the operations used in indexing- init, add
uint8_t *columns;

// other members, always used
char *metadata_index_filename;
FILE *metadata_index_fp;

Expand Down

0 comments on commit 275a824

Please sign in to comment.