[Mesa-dev] [PATCH 0/4] use memcmp instead of strncmp when string lengths are known

Vlad Golovkin vlad.golovkin.mail at gmail.com
Tue May 30 22:45:12 UTC 2017


This series contains a couple of trivial changes, mostly places where the code looks like this:
if (len1 == len2 && (strncmp(str1, str2, len1)) ...
It is better to use memcmp here because there is no need to check for the terminating null byte

Vlad Golovkin (4):
  glsl: simplify +INF check
  glsl: trivial change of the file extension matching
  util: use memcmp instead of strncmp
  glx: use memcmp instead of strncmp

 src/compiler/glsl/s_expression.cpp |  2 +-
 src/compiler/glsl/standalone.cpp   | 17 ++++++++++-------
 src/glx/glxextensions.c            |  2 +-
 src/util/debug.c                   |  2 +-
 4 files changed, 13 insertions(+), 10 deletions(-)

-- 
2.11.0



More information about the mesa-dev mailing list