Skip to content

Commit

Permalink
Merge pull request #283 from Gottox/improve/extract_view-cleanup
Browse files Browse the repository at this point in the history
extract_view: remove field offset. Was never used.
  • Loading branch information
Gottox authored Aug 14, 2024
2 parents a1d880f + 80781cf commit a17cd88
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion libsqsh/include/sqsh_extract_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ struct SqshExtractView {
*/
struct SqshExtractManager *manager;
const struct CxBuffer *buffer;
size_t offset;
size_t size;
};

Expand Down
5 changes: 1 addition & 4 deletions libsqsh/src/extract/extract_view.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ sqsh__extract_view_init(
const struct SqshMapReader *reader) {
int rv = 0;
view->manager = manager;
view->offset = 0;
view->buffer = NULL;

rv = sqsh__extract_manager_uncompress(manager, reader, &view->buffer);
Expand All @@ -61,8 +60,7 @@ sqsh__extract_view_init(

const uint8_t *
sqsh__extract_view_data(const struct SqshExtractView *view) {
const uint8_t *data = cx_buffer_data(view->buffer);
return &data[view->offset];
return cx_buffer_data(view->buffer);
}

size_t
Expand All @@ -79,6 +77,5 @@ sqsh__extract_view_cleanup(struct SqshExtractView *view) {
}
view->buffer = NULL;
view->size = 0;
view->offset = 0;
return rv;
}

0 comments on commit a17cd88

Please sign in to comment.