Skip to content

Commit 7b5cbf3

Browse files
committed
fix(chapter11): simplify resource allocation logic by removing unreachable code
1 parent 2a66a3b commit 7b5cbf3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

chapter11/src/case13/case13.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ def get(self):
2929
result = Resource.create()
3030
self.allocated.append(result)
3131
else:
32-
try:
33-
result = self.available.pop()
34-
self.allocated.append(result)
35-
except IndexError:
36-
raise AssertionError("you cannot reach here!")
32+
result = self.available.pop()
33+
self.allocated.append(result)
3734

3835
return result

0 commit comments

Comments
 (0)