Skip to content
  • Junio C Hamano's avatar
    diffcore-pickaxe: port optimization from has_changes() to diff_grep() · ebb72262
    Junio C Hamano authored
    
    
    These two functions are called in the same codeflow to implement
    "log -S<block>" and "log -G<pattern>", respectively, but the latter
    lacked two obvious optimizations the former implemented, namely:
    
     - When a pickaxe limit is not given at all, they should return
       without wasting any cycle;
    
     - When both sides of the filepair are the same, and the same
       textconv conversion apply to them, return early, as there will be
       no interesting differences between the two anyway.
    
    Also release the filespec data once the processing is done (this is
    not about leaking memory--it is about releasing data we finished
    looking at as early as possible).
    
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    ebb72262