Closed spg closed 5 years ago
Looks good. You can improve performance a bit by removing the call to .split and using slice notation instead. E.g.
separator = resource[first_separator_index]
resource_type, resource = resource.split(separator, 1)
becomes
resource_type = resource[:first_separator_index]
resource = resource[first_separator_index+1:]
A sanity check / unit test for a single delimiter at the end of the original resource string might not be a bad idea if you don't have one already - I'm writing this up from memory and haven't personally tested the edge cases for the code above.
@ebickle thanks for the suggestion! Done in 6626331
…rce"
Fixes https://github.com/PokaInc/arnparse/issues/3