> ## 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.

# Swap Nested Ifs

#### Sourcery refactoring id: `swap-nested-ifs`

#### Description:

Swaps the order of nested `if` statements

#### Before:

```python
if a:
    if b:
        return c
```

#### After:

```python
if b:
    if a:
        return c
```

#### Explanation:

This refactoring identity will not improve code quality on its own, but can be
part of a series of steps that will improve quality. Sourcery will only suggest
this refactoring where it unlocks further improvements.
