Skip to content

Commit 99d99ee

Browse files
committed
minor optimization
1 parent 41f2ea2 commit 99d99ee

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/org/cicirello/permutations/Permutation.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* manipulate permutations in a variety of ways.
3737
*
3838
* @author <a href=https://www.cicirello.org/ target=_top>Vincent A. Cicirello</a>, <a href=https://www.cicirello.org/ target=_top>https://www.cicirello.org/</a>
39-
* @version 1.19.5.10
39+
* @version 1.19.5.13
4040
* @since 1.0
4141
*/
4242
public final class Permutation implements Serializable, Iterable<Permutation>
@@ -274,7 +274,9 @@ public int[] getInverse() {
274274
* @since 1.3
275275
*/
276276
public Permutation getInversePermutation() {
277-
return new Permutation(getInverse());
277+
Permutation copy = new Permutation(this);
278+
copy.invert();
279+
return copy;
278280
}
279281

280282
/**

0 commit comments

Comments
 (0)