]> source.dussan.org Git - jgit.git/commit
refactor: simplify collection.toArray() 94/127094/3
authorMichael Keppler <Michael.Keppler@gmx.de>
Mon, 6 Aug 2018 12:11:26 +0000 (14:11 +0200)
committerJonathan Nieder <jrn@google.com>
Thu, 23 Aug 2018 05:34:39 +0000 (01:34 -0400)
commit2fc00af44e5658cf34200ad20d777a75333a0564
tree4176d6c478946dee29d54fac9d6eb2f91bdbb613
parent7058493fea6992c914a200b64f48b0b61f192ac0
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: I80388532fb4b2b0663ee1fe8baa94f5df55c8442
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
25 files changed:
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/SmartServiceInfoRefs.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/ServletBinderImpl.java
org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java
org.eclipse.jgit.pgm.test/src/org/eclipse/jgit/pgm/CLIGitCommand.java
org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ArchiveTest.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Describe.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Remote.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/CmdLineParser.java
org.eclipse.jgit.test/src/org/eclipse/jgit/events/ChangeRecorder.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ReflogCommandTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/KetchLeader.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/LocalReplica.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LocalCachedPack.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/BaseSearch.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotWalk.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/CredentialsProvider.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/OpenSshConfig.java
org.eclipse.jgit/src/org/eclipse/jgit/util/FS_Win32.java