Skip to content

Conversation

@umutoztunc
Copy link
Contributor

@umutoztunc umutoztunc commented Mar 18, 2021

I thought of implementing it using a 256-bit bitmap. Like storing characters in s2 like a blacklist to stop iteration of s1. However, it might be an overkill to create a bitmap for overall use-cases. Under most circumstances, the length of s2 should be way smaller than s1. Thus, I decided to copy the implementation from Bionic like some other functions in string.h.

I was planning to write some test cases, but I noticed there are no test cases for functions like strchr and the test structure looked a bit weird to me. It might be better to refactor the tests at some point. Still, I can write tests similar to fgets if you'd like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant