Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] - 2026-07-07
## [Unreleased] - 2026-07-28

### Added

### Changed
* Refactored Permutation.equals() method (non-breaking).

### Deprecated

Expand Down
13 changes: 4 additions & 9 deletions src/main/java/org/cicirello/permutations/Permutation.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* JavaPermutationTools: A Java library for computation on permutations and sequences
* Copyright 2005-2024 Vincent A. Cicirello, <https://www.cicirello.org/>.
* Copyright 2005-2026 Vincent A. Cicirello, <https://www.cicirello.org/>.
*
* This file is part of JavaPermutationTools (https://jpt.cicirello.org/).
*
Expand Down Expand Up @@ -917,15 +917,10 @@ public String toString() {
*/
@Override
public boolean equals(Object other) {
if (this == other) return true;
if (other == null) return false;
if (!(other instanceof Permutation)) return false;
Permutation o = (Permutation) other;
if (permutation.length != o.permutation.length) return false;
for (int i = 0; i < permutation.length; i++) {
if (permutation[i] != o.permutation[i]) return false;
if (other instanceof Permutation o) {
return Arrays.equals(permutation, o.permutation);
}
return true;
return false;
}

/**
Expand Down
Loading