> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Non Equal Comparison

#### Sourcery refactoring id: `non-equal-comparison`

#### Description

Simplify comparison of non equal values

#### Before

```python
def compare(a: int, b: int):
    if a < b:
        return True
    elif a > b:
        return False
```

#### After

```python
def compare(a: int, b: int):
    if a != b:
        return a < b
```

#### Explanation

If we are comparing two numbers and returning only if they are non equal we can
simplifiy the form of this expression.

Removing an if statement and merging two comparisons makes the code shorter and
easier to read.
