Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2018-08-06 12:10:45 +0000
committerThomas Wolf2018-08-14 09:47:24 +0000
commitc3be20c9ab85f074725c0defe6c349ae768f7661 (patch)
tree71e367ca809952493cb869f0f012b1c389960147 /org.eclipse.mylyn.github.ui
parent6b603f5ea4b9b17bee51bb777373a5448a62e860 (diff)
downloadegit-github-c3be20c9ab85f074725c0defe6c349ae768f7661.tar.gz
egit-github-c3be20c9ab85f074725c0defe6c349ae768f7661.tar.xz
egit-github-c3be20c9ab85f074725c0defe6c349ae768f7661.zip
refactor: simplify collection.toArray()
On recent VMs, collection.toArray(new T[0]) is faster than collection.toArray(new T[collection.size()]). Since it is also more readable, it should now be the preferred way of collection to array conversion. https://shipilev.net/blog/2016/arrays-wisdom-ancients/ Change-Id: Ie1a23d2a278ccd677b9c92da9677864d1ba09cde Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Diffstat (limited to 'org.eclipse.mylyn.github.ui')
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueConnectorUi.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueConnectorUi.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueConnectorUi.java
index 75e3d998..99f0f491 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueConnectorUi.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/issue/IssueConnectorUi.java
@@ -168,7 +168,7 @@ public class IssueConnectorUi extends AbstractRepositoryConnectorUi {
}
}
}
- return hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
+ return hyperlinks.toArray(new IHyperlink[0]);
}
private Region createRegion(int textOffset, Matcher matcher) {

Back to the top