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
issue8851 #2533
issue8851 #2533
Conversation
resultLen += temp.front.length + sepArrLength; | ||
resultLen -= sepArrLength; | ||
result.reserve(resultLen); | ||
version(unittest) scope(exit) assert(result.data.length == resultLen); |
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.
What's this for?
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.
sanity checking
Looks OK to me, though I wonder if we should put a generic version in |
@@ -1684,6 +1683,53 @@ ElementEncodingType!(ElementType!RoR)[] join(RoR, R)(RoR ror, R sep) | |||
} | |||
|
|||
/// Ditto | |||
ElementEncodingType!(ElementType!RoR)[] join(RoR, R)(RoR ror, R sep) |
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.
Please change R
for E
, since sep
is of type "element".
|
&& !is(RetTypeElement == dchar)) | ||
{ | ||
RetTypeElement[4] encodeSpace; | ||
immutable sepArrLength = encode(encodeSpace, to!dchar(sep)); |
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.
Just nitpick, but is this "to" necessary? It adds a bounds check overhead, which should be covered in encode anyways.
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.
it was not necessary, thanks for catching that
@monarchdodra Fair enough. Looks good to me. |
Auto-merge toggled on |
thanks @quickfur and @monarchdodra |
https://issues.dlang.org/show_bug.cgi?id=8851
join with single char