-
Notifications
You must be signed in to change notification settings - Fork 428
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
Riak vcard #460
Riak vcard #460
Conversation
travis is using test branch |
@@ -28,3 +29,16 @@ string_to_binary(S) when is_list(S) -> | |||
end; | |||
string_to_binary(B) when is_binary(B) -> | |||
B. | |||
|
|||
|
|||
join([], _) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this could be more optimal:
join(Parts, Sep) when is_integer(Sep) -> join(Parts, <<Sep>>);
join(Parts, Sep) -> join(Parts, Sep, <<>>).
join([], _Sep, Acc) -> Acc;
join([Part], _Sep, Acc) -> <<Acc/binary, Part/binary>>;
join([Part | RParts], Sep, Acc) -> join2(RParts, Sep, <<Acc/binary, Part/binary, Sep/binary>>).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually some time ago I saw some micro-benchmarking done by @arcusfelis showing that io_list_to_binary
is faster than incrementally built binary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, true, I think I saw it too. I wonder if it still holds with current OTP versions (AFAIR those were done with R16).
Riak backend for mod_vcard.
This is done on top of #378