diff options
author | Carl Worth <[email protected]> | 2012-11-28 12:03:50 -0800 |
---|---|---|
committer | Carl Worth <[email protected]> | 2012-11-29 13:03:01 -0800 |
commit | ea34ac499d46407d8d90baa4a8fd9082ba6b3ea7 (patch) | |
tree | 25f09edbbfe989ab3878b1802b7ff8b00b17ae4a /src/glsl | |
parent | 907a10378e4c63686abe0739634b30615018ccd1 (diff) |
glcpp: Factor out a tiny bit of repeated code.
This function is getting a little long too read. Simplify it by pulling
up one assignment from every condition.
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/glcpp/glcpp-parse.y | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index d9280443c81..5b322fa14c0 100644 --- a/src/glsl/glcpp/glcpp-parse.y +++ b/src/glsl/glcpp/glcpp-parse.y @@ -1528,6 +1528,7 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser, return NULL; } + *last = node; identifier = token->value.str; /* Special handling for __LINE__ and __FILE__, (not through @@ -1541,7 +1542,6 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser, node->token->location.first_line); _token_list_append (replacement, value); - *last = node; return replacement; } @@ -1554,7 +1554,6 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser, node->token->location.source); _token_list_append (replacement, value); - *last = node; return replacement; } @@ -1579,14 +1578,12 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser, final = _token_create_str (parser, OTHER, str); expansion = _token_list_create (parser); _token_list_append (expansion, final); - *last = node; return expansion; } if (! macro->is_function) { token_list_t *replacement; - *last = node; /* Replace a macro defined as empty with a SPACE token. */ if (macro->replacements == NULL) |