[all-commits] [llvm/llvm-project] 6778db: [DomTree] Avoid duplicate hash lookup (NFC)

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Nov 27 06:05:20 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6778dbe50228ea47c586d7b9b60ef57a78915148
      https://github.com/llvm/llvm-project/commit/6778dbe50228ea47c586d7b9b60ef57a78915148
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-11-27 (Mon, 27 Nov 2023)

  Changed paths:
    M llvm/include/llvm/Support/GenericDomTreeConstruction.h

  Log Message:
  -----------
  [DomTree] Avoid duplicate hash lookup (NFC)

We're performing the same lookup twice here, just to access
different fields. Only perform it once.

Also prefer using find() over operator[], as we do not want to
perform an insert if the node does not exist.




More information about the All-commits mailing list