commit | 43a1dc799f068daaf5487e92ace90ad65d0560bf | [log] [tgz] |
---|---|---|
author | shreyax <shreyax@google.com> | Sat Jun 02 15:08:51 2018 -0700 |
committer | Copybara-Service <copybara-piper@google.com> | Sat Jun 02 15:09:58 2018 -0700 |
tree | d8a965f43f61c869aa9dee452a36024bc3a05086 | |
parent | ff008f445905bf6f4601a368782b620f7899d322 [diff] [blame] |
Fast-path Label#equals by first comparing the interned PackageIdentifier. PiperOrigin-RevId: 199007753
diff --git a/src/main/java/com/google/devtools/build/lib/cmdline/PackageIdentifier.java b/src/main/java/com/google/devtools/build/lib/cmdline/PackageIdentifier.java index d8bf3bf..8d7ad19 100644 --- a/src/main/java/com/google/devtools/build/lib/cmdline/PackageIdentifier.java +++ b/src/main/java/com/google/devtools/build/lib/cmdline/PackageIdentifier.java
@@ -46,6 +46,7 @@ @AutoCodec.Instantiator public static PackageIdentifier create(RepositoryName repository, PathFragment pkgName) { + // Note: We rely on these being interned to fast-path Label#equals. return INTERNER.intern(new PackageIdentifier(repository, pkgName)); }