diff --git a/pyproject.toml b/pyproject.toml index 5b0783f..a3a5848 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ source = [ [tool.coverage.report] skip_covered = true -fail_under = 99 +fail_under = 100 [tool.coverage.html] directory = "htmlcov/" diff --git a/sqids/sqids.py b/sqids/sqids.py index 5daaafa..ad173cf 100644 --- a/sqids/sqids.py +++ b/sqids/sqids.py @@ -110,13 +110,12 @@ def decode(self, id_: str) -> List[int]: while id_: separator = alphabet[0] chunks = id_.split(separator) - if chunks: - if not chunks[0]: - return ret + if not chunks[0]: + return ret - ret.append(self.__to_number(chunks[0], alphabet[1:])) - if len(chunks) > 1: - alphabet = self.__shuffle(alphabet) + ret.append(self.__to_number(chunks[0], alphabet[1:])) + if len(chunks) > 1: + alphabet = self.__shuffle(alphabet) id_ = separator.join(chunks[1:])