From: Pablo Neira Ayuso Date: Mon, 9 Dec 2024 00:23:08 +0000 (+0100) Subject: src: remove unused token_offset from struct location X-Git-Tag: v1.1.2~111 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=84360b2ab9960076c02cca9cfed0edce7bfadb17;p=thirdparty%2Fnftables.git src: remove unused token_offset from struct location This saves 8 bytes in x86_64 in struct location which is embedded in every expression. This shrinks struct expr to 120 bytes according to pahole. Signed-off-by: Pablo Neira Ayuso --- diff --git a/include/nftables.h b/include/nftables.h index c25deb36..7d891b43 100644 --- a/include/nftables.h +++ b/include/nftables.h @@ -158,7 +158,6 @@ struct location { const struct input_descriptor *indesc; union { struct { - off_t token_offset; off_t line_offset; unsigned int first_line; diff --git a/src/parser_bison.y b/src/parser_bison.y index 6e6f3cf8..6e8b6391 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -102,7 +102,6 @@ static void location_update(struct location *loc, struct location *rhs, int n) { if (n) { loc->indesc = rhs[n].indesc; - loc->token_offset = rhs[1].token_offset; loc->line_offset = rhs[1].line_offset; loc->first_line = rhs[1].first_line; loc->first_column = rhs[1].first_column; @@ -110,7 +109,6 @@ static void location_update(struct location *loc, struct location *rhs, int n) loc->last_column = rhs[n].last_column; } else { loc->indesc = rhs[0].indesc; - loc->token_offset = rhs[0].token_offset; loc->line_offset = rhs[0].line_offset; loc->first_line = loc->last_line = rhs[0].last_line; loc->first_column = loc->last_column = rhs[0].last_column; diff --git a/src/scanner.l b/src/scanner.l index c825fa79..ecdba404 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -90,7 +90,6 @@ static void update_offset(struct parser_state *state, struct location *loc, unsigned int len) { state->indesc->token_offset += len; - loc->token_offset = state->indesc->token_offset; loc->line_offset = state->indesc->line_offset; }