Skip to content

Commit

Permalink
Don't call of if the object will be same as this
Browse files Browse the repository at this point in the history
  • Loading branch information
mrotteveel committed May 26, 2024
1 parent 4722d82 commit a24cc3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/org/firebirdsql/gds/ng/OdsVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public int minor() {
* @return instance with value of parameter {@code major} and {@link #minor()} of this instance
*/
public OdsVersion withMajor(int major) {
return of(major, minor);
return this.major != major ? of(major, minor) : this;
}

/**
Expand All @@ -105,7 +105,7 @@ public OdsVersion withMajor(int major) {
* @return instance with {@link #major()} of this instance and value of parameter {@code minor}
*/
public OdsVersion withMinor(int minor) {
return of(major, minor);
return this.minor != minor ? of(major, minor) : this;
}

@Override
Expand Down

0 comments on commit a24cc3e

Please sign in to comment.