Avoid opening extra ReviewDb connection in PatchSetInfoFactory

Every caller already had a ReviewDb "handy". Rather than making
a new connection, use the existing one from the caller to read
records about the patch set from the database.

Change-Id: I68de1aa293f81b4318d681851706556bb73a5fd7
This commit is contained in:
Shawn O. Pearce
2011-10-28 15:57:04 -07:00
parent 2d82b4a84e
commit d3743450a2
7 changed files with 8 additions and 18 deletions

View File

@@ -136,7 +136,7 @@ public abstract class ChangeEmail extends OutgoingEmail {
if (patchSet != null && patchSetInfo == null) {
try {
patchSetInfo = args.patchSetInfoFactory.get(patchSet.getId());
patchSetInfo = args.patchSetInfoFactory.get(args.db.get(), patchSet.getId());
} catch (PatchSetInfoNotAvailableException err) {
patchSetInfo = null;
}