glcpp: Avoid unnecessary call to strlen
authorThomas Helland <thomashelland90@gmail.com>
Sat, 20 May 2017 22:21:54 +0000 (00:21 +0200)
committerThomas Helland <thomashelland90@gmail.com>
Tue, 26 Sep 2017 16:25:38 +0000 (18:25 +0200)
commitd86bc364469b1a413de5dbc357de0516b506e29e
tree95bbb8a7d0386e41159c8af43b1936016ef4a643
parente7220d2c22b55b8305e5338b80483a6659fb15c8
glcpp: Avoid unnecessary call to strlen

Length of the token was already calculated by flex and stored in yyleng,
no need to implicitly call strlen() via linear_strdup().

Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
V2: Also convert this pattern in glsl_lexer.ll

V3: Remove a misplaced comment

V4: Use a temporary char to avoid type change
    Remove bogus +1 on length check of identifier
src/compiler/glsl/glcpp/glcpp-lex.l
src/compiler/glsl/glsl_lexer.ll