Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改了sds.c和sds.h,降低了sdstrim的时间复杂度 #5

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

BillWangCS
Copy link

黄大神,我发现sdstrim的查找操作(strchr)可以用字符哈希的思想重写,将查找复杂度降为O(1),从而使整个trim的时间复杂度降为O(M+N),M为c字符串长度,N为SDS的buf长度,你看看对不对?

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