mirror of
https://github.com/github/codeql.git
synced 2026-01-14 06:54:48 +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
|