[all-commits] [llvm/llvm-project] 638b0f: [ADT][NFC] Early bail out for ComputeEditDistance

Nathan James via All-commits all-commits at lists.llvm.org
Wed Jun 8 00:20:45 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 638b0fb4d6517cb6517df88eeae2d0210d021040
      https://github.com/llvm/llvm-project/commit/638b0fb4d6517cb6517df88eeae2d0210d021040
  Author: Nathan James <n.james93 at hotmail.co.uk>
  Date:   2022-06-08 (Wed, 08 Jun 2022)

  Changed paths:
    M llvm/include/llvm/ADT/edit_distance.h
    M llvm/unittests/ADT/CMakeLists.txt
    A llvm/unittests/ADT/EditDistanceTest.cpp

  Log Message:
  -----------
  [ADT][NFC] Early bail out for ComputeEditDistance

The minimun bound for number of edits is the size difference between the 2 arrays.
If MaxEditDistance is smaller than this, we can bail out early without needing to traverse any of the arrays.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D127070




More information about the All-commits mailing list