Skip to content

Commit

Permalink
FreeingMethods: optimize Collection.toArray() usage
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jun 22, 2024
1 parent ca0d00a commit 7894e02
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 7894e02

Please sign in to comment.