Here is my code:

**Version 1**

```
def X():
    while True:
        pos = something.find("xxx")
        if pos != -1:
            yield pos
        break

```

**Version 2**

```
def X():
    while True:
        pos = something.find("xxx")
        if pos == -1:
            break
        yield pos

```

Version 1 only gave me 1 result, while version 2 gave me all results! WTF?