From 210c75ed5fca7de0047a7d06bf1a2208e0e87d9c Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Thu, 7 Jul 2022 15:09:50 +0100 Subject: [PATCH] reduce time complexity of range checks patch bump --- pyproject.toml | 2 +- voicemeeterlib/vban.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ab77e17..e156b7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "voicemeeter-api" -version = "0.2.1" +version = "0.2.2" description = "A Python wrapper for the Voiceemeter API" authors = ["onyx-and-iris "] license = "MIT" diff --git a/voicemeeterlib/vban.py b/voicemeeterlib/vban.py index 7f929d9..5964843 100644 --- a/voicemeeterlib/vban.py +++ b/voicemeeterlib/vban.py @@ -49,7 +49,7 @@ class VbanStream(IRemote): @port.setter def port(self, val: int): - if val not in range(1024, 65536): + if not 1024 <= val <= 65535: raise VMError("Expected value from 1024 to 65535") self.setter("port", val) @@ -70,7 +70,7 @@ class VbanStream(IRemote): @channel.setter def channel(self, val: int): - if val not in range(1, 9): + if not 1 <= val <= 8: raise VMError("Expected value from 1 to 8") self.setter("channel", val) @@ -90,7 +90,7 @@ class VbanStream(IRemote): @quality.setter def quality(self, val: int): - if val not in range(5): + if not 0 <= val <= 4: raise VMError("Expected value from 0 to 4") self.setter("quality", val) @@ -100,7 +100,7 @@ class VbanStream(IRemote): @route.setter def route(self, val: int): - if val not in range(9): + if not 0 <= val <= 8: raise VMError("Expected value from 0 to 8") self.setter("route", val)