From 2de30a2224bcfa686fe354586891b340388f81cc Mon Sep 17 00:00:00 2001 From: Florian Scholdei Date: Mon, 21 Sep 2020 11:01:22 +0200 Subject: [PATCH] Use array find instead of filter --- scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx b/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx index 7646051b1b..b8dfd47544 100644 --- a/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx +++ b/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx @@ -70,7 +70,7 @@ class ChangesetsRoot extends React.Component { } const url = urls.stripEndingSlash(match.url); - const defaultBranch = branches?.filter(b => b.defaultBranch === true)[0]; + const defaultBranch = branches?.find(b => b.defaultBranch === true); return ( <>