Skip to content

Conversation

wmeints
Copy link
Contributor

@wmeints wmeints commented Apr 15, 2016

Fixes issue #1852 where the method IndexOf(x) for a concatenated set
of byte strings would throw an index out of range exception when the
element doesn't exist in the either one of the strings.

Included two tests to confirm that existing and non-existing element situations work.

get
{
if (!IsEmpty) return _array[_offset];
return default(T);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think head should throw if the list is empty, I would expect the same behavior as with First. Also suggests the name offset that it could throw indexoutofrange even if the list isn't empty, offset >= count

@wmeints
Copy link
Contributor Author

wmeints commented Apr 15, 2016

Thanks for reviewing. Will revert that part and see if there's a better way to solve the problem.

Fixes issue #1852 where the method IndexOf(x) for a concatenated set
of byte strings would throw an index out of range exception when the
element doesn't exist in the either one of the strings.
@marcpiechura
Copy link
Contributor

Looks good to me 👍

@marcpiechura marcpiechura merged commit bff97f7 into akkadotnet:dev Apr 15, 2016
@wmeints wmeints deleted the fix-concatenated-byte-strings branch April 16, 2016 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants