commit | 5bf27973c2fd9b3bc0c46e26e1b00b2ab220e0ef | [log] [tgz] |
---|---|---|
author | Dave Borowitz <dborowitz@google.com> | Thu Jan 16 16:36:56 2014 -0800 |
committer | Dave Borowitz <dborowitz@google.com> | Thu Jan 16 16:36:56 2014 -0800 |
tree | fa65c4eb1dec8a014dc0819de30423069b62a62d | |
parent | 88dd894720327f060c5992ea932b6703d276ff09 [diff] |
Avoid duplicate SUBM approvals during submission ApprovalsUtil.getSubmitter is not guaranteed to return a SUBM approval if there is one in the input list, for example if there is a corrupt PatchSetApproval with SUBM <= 0. A database implementation may choke on an upsert call with multiple entities having the same primary key (e.g. the old and new SUBM approvals), so explicitly avoid this by storing approvals in a map by key. Change-Id: I3d3225744abc434ed991d08c4df573647e1ae712