Skip to content

Commit

Permalink
Use Python integer division instead of floor
Browse files Browse the repository at this point in the history
  • Loading branch information
b-wils committed Jul 12, 2024
1 parent f6d81c5 commit 48cb27f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/schema-validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def collect_defs(self, schema):
def check_version(self, schema: Schema):
versionNumber = schema["$version"]

majorVersion = math.floor(versionNumber / 10000)
minorVersion = math.floor((versionNumber % 10000) / 100)
majorVersion = versionNumber // 10000
minorVersion = (versionNumber % 10000) // 100
patchVersion = versionNumber % 100

versionString = f'{majorVersion}.{minorVersion}.{patchVersion}'
Expand Down

0 comments on commit 48cb27f

Please sign in to comment.