mirror of
https://github.com/github/codeql.git
synced 2025-12-31 08:06:36 +01:00
22 lines
481 B
Python
22 lines
481 B
Python
def pointless_else(container):
|
|
for item in container:
|
|
if of_interest(item):
|
|
return item
|
|
else:
|
|
raise NotFoundException()
|
|
|
|
def no_else(container):
|
|
for item in container:
|
|
if of_interest(item):
|
|
return item
|
|
raise NotFoundException()
|
|
|
|
def with_break(container):
|
|
for item in container:
|
|
if of_interest(item):
|
|
found = item
|
|
break
|
|
else:
|
|
raise NotFoundException()
|
|
return found
|