3 ms·
Are you sure the second one isn’t just declaring not_found as a stand-in for 404 so the case statement two lines below can refer to business logic rather than a
by dpritchett 6y ago
Are you sure the second one isn’t just declaring not_found as a stand-in for 404 so the case statement two lines below can refer to business logic rather than a “magic” constant?
I would NOT expect for the line “case not_found:” to reassign the status variable to 404 regardless of what it was before.
I can’t see how or why that would be intended behavior.
- deleted 6y ago[deleted]
- pansa2 6y ago> Are you sure the second one isn’t just declaring not_found as a stand-in for 404 That's what it looks like, but no, the refactoring really does change an equality test into an assignment.
- remram 6y agoIt doesn't reassign the 'status' variable, it reassigns the 'not_found" variable.