• J
    implement ends_with via strip_suffix · f52a35fd
    Jeff King 提交于
    The ends_with function is essentially a simplified version
    of strip_suffix, in which we throw away the stripped length.
    Implementing it as an inline on top of strip_suffix has two
    advantages:
    
      1. We save a bit of duplicated code.
    
      2. The suffix is typically a string literal, and we call
         strlen on it. By making the function inline, many
         compilers can replace the strlen call with a constant.
    Signed-off-by: NJeff King <peff@peff.net>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    f52a35fd
strbuf.c 11.4 KB