mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-04 10:48:19 +00:00
fix(valid-detection-benchmark): collapse nested precondition guard ifs
Ruff SIM102: combine the IfMatch precondition check into one condition; behavior unchanged.
This commit is contained in:
@@ -67,8 +67,7 @@ class _Client:
|
|||||||
if kwargs.get("IfNoneMatch") == "*" and current is not None and not self.ignore_if_none_match:
|
if kwargs.get("IfNoneMatch") == "*" and current is not None and not self.ignore_if_none_match:
|
||||||
raise _ProviderError("PreconditionFailed")
|
raise _ProviderError("PreconditionFailed")
|
||||||
expected = kwargs.get("IfMatch")
|
expected = kwargs.get("IfMatch")
|
||||||
if expected is not None and not self.allow_two_winners:
|
if expected is not None and not self.allow_two_winners and (current is None or current.etag != expected):
|
||||||
if current is None or current.etag != expected:
|
|
||||||
raise _ProviderError("PreconditionFailed")
|
raise _ProviderError("PreconditionFailed")
|
||||||
version_id = self.fixed_version_id or f"version-{self._next_version}"
|
version_id = self.fixed_version_id or f"version-{self._next_version}"
|
||||||
self._next_version += 1
|
self._next_version += 1
|
||||||
|
|||||||
Reference in New Issue
Block a user