From 7894e0291fcffc29a5ffdd228b0e0949c3e8c096 Mon Sep 17 00:00:00 2001 From: stephengold Date: Sat, 22 Jun 2024 15:03:12 -0700 Subject: [PATCH] FreeingMethods: optimize Collection.toArray() usage --- .../src/main/java/com/jme3/bullet/FreeingMethods.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MinieLibrary/src/main/java/com/jme3/bullet/FreeingMethods.java b/MinieLibrary/src/main/java/com/jme3/bullet/FreeingMethods.java index 7fe09fa9b..06752b78f 100644 --- a/MinieLibrary/src/main/java/com/jme3/bullet/FreeingMethods.java +++ b/MinieLibrary/src/main/java/com/jme3/bullet/FreeingMethods.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 jMonkeyEngine + * Copyright (c) 2021-2024 jMonkeyEngine * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -114,8 +114,7 @@ private static Method[] generate( } } - int numMethods = methods.size(); - Method[] result = new Method[numMethods]; + Method[] result = methods.toArray(new Method[0]); methods.toArray(result); return result;