Skip to content
  • brian m. carlson's avatar
    define utility functions for object IDs · aa1c6fdf
    brian m. carlson authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    There are several utility functions (hashcmp and friends) that are used
    for comparing object IDs (SHA-1 values).  Using these functions, which
    take pointers to unsigned char, with struct object_id requires tiresome
    access to the sha1 member, which bloats code and violates the desired
    encapsulation.  Provide wrappers around these functions for struct
    object_id for neater, more maintainable code.  Use the new constants to
    avoid the hard-coded 20s and 40s throughout the original functions.
    
    These functions simply call the underlying pointer-to-unsigned-char
    versions to ensure that any performance improvements will be passed
    through to the new functions.
    
    Signed-off-by: default avatarbrian m. carlson <sandals@crustytoothpaste.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    aa1c6fdf