• Christian Couder's avatar
    strbuf: introduce starts_with() and ends_with() · 95662315
    Christian Couder authored
    prefixcmp() and suffixcmp() share the common "cmp" suffix that
    typically are used to name functions that can be used for ordering,
    but they can't, because they are not antisymmetric:
    
            prefixcmp("foo", "foobar") < 0
            prefixcmp("foobar", "foo") == 0
    
    We in fact do not use these functions for ordering.  Replace them
    with functions that just check for equality.
    
    Add starts_with() and end_with() that will be used to replace
    prefixcmp() and suffixcmp(), respectively, as the first step.  These
    are named after corresponding functions/methods in programming
    languages, like Java, Python and Ruby.
    
    In vcs-svn/fast_export.c, there was already an ends_with() function
    that did the same thing. Let's use the new one instead while at it.
    Signed-off-by: Christian Couder's avatarChristian Couder <chriscool@tuxfamily.org>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    95662315
Name
Last commit
Last update
..
LICENSE Loading commit data...
fast_export.c Loading commit data...
fast_export.h Loading commit data...
line_buffer.c Loading commit data...
line_buffer.h Loading commit data...
line_buffer.txt Loading commit data...
repo_tree.c Loading commit data...
repo_tree.h Loading commit data...
sliding_window.c Loading commit data...
sliding_window.h Loading commit data...
svndiff.c Loading commit data...
svndiff.h Loading commit data...
svndump.c Loading commit data...
svndump.h Loading commit data...