Closed jjlin closed 11 years ago
This fix makes perfect sense, I especially like the code reuse.
Have you tested this on both linux and BSD/OS X?
I don't believe there are any test cases which cover the changed lines (yet).
I don't have any BSD or OS X systems, so Linux only. This code ends up getting called by nearly every command when no specific list of castles is provided, so I'd think it should be mostly pretty obvious if it breaks.
Tested on OSX now, didn't have the time to add unit tests though.
The 'find' command outputs castles in an arbitrary order, which can be annoying in some cases (e.g., when listing all castles and trying to find a particular one by sight).