Skip to content

Commit

Permalink
Assert
Browse files Browse the repository at this point in the history
  • Loading branch information
n1v0lg committed Nov 20, 2023
1 parent f63c4fc commit 157c945
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,17 @@ int asInt() {
}

public boolean ableToStartNewTrial() {
// It should never be possible for trialVersion to be greater than CURRENT...
if (asInt() < TRIAL_VERSION_CUTOVER) {
int sinceMajorVersion = asInt() / 1_000_000; // integer division is intentional
assert trialVersion <= CURRENT.trialVersion
: "trial version ["
+ trialVersion
+ "] cannot be greater than CURRENT ["
+ CURRENT.trialVersion
+ "] which represents the maximum possible value";
if (trialVersion < TRIAL_VERSION_CUTOVER) {
int sinceMajorVersion = trialVersion / 1_000_000; // integer division is intentional
return sinceMajorVersion < TRIAL_VERSION_CUTOVER_MAJOR;
}
return trialVersion < CURRENT.asInt();
return trialVersion != CURRENT.trialVersion;
}

@Override
Expand Down

0 comments on commit 157c945

Please sign in to comment.