Fix trivial usages of deprecated RefDatabase.getRefs method

getRefs(String) returns Map<String, Ref>; most callers only call its
values() method and iterate over the list of Ref objects. It's trivial
to replace those calls with getRefsByPrefix which returns a List<Ref>.

Change-Id: Iad142ea8a0dec69b22fcec084bb66eafd79c2a0d
This commit is contained in:
David Pursehouse
2018-06-01 19:55:16 +09:00
parent 895d678b4f
commit f717f06986
26 changed files with 34 additions and 40 deletions

View File

@@ -498,7 +498,7 @@ public class CommentsUtil {
}
private Collection<Ref> getDraftRefs(Repository repo, Change.Id changeId) throws IOException {
return repo.getRefDatabase().getRefs(RefNames.refsDraftCommentsPrefix(changeId)).values();
return repo.getRefDatabase().getRefsByPrefix(RefNames.refsDraftCommentsPrefix(changeId));
}
private static <T extends Comment> List<T> sort(List<T> comments) {