Skip to content

Comments

Remove unnessesary call to text from std.conv.convError#5233

Merged
dlang-bot merged 1 commit intodlang:masterfrom
JackStouffer:convError
Apr 28, 2017
Merged

Remove unnessesary call to text from std.conv.convError#5233
dlang-bot merged 1 commit intodlang:masterfrom
JackStouffer:convError

Conversation

@JackStouffer
Copy link
Contributor

Removes an extra array allocation.

text("Unexpected ", convError_unexpected(source),
" when converting from type "~S.stringof~" to type "~T.stringof),
fn, ln);
if (source.empty)
Copy link
Contributor

@wilzbach wilzbach Mar 4, 2017

Choose a reason for hiding this comment

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

How about?

enforce!ConvException(!source.empty, ...)

@dnadlinger
Copy link
Contributor

string msg; if (…) { msg = …; } else { … } throw new ConvException(msg, fn, ln);?

+32 -14 for something that mostly allocates all the same afterwards doesn't look too great.

@JackStouffer
Copy link
Contributor Author

@klickverbot Changed

@John-Colvin
Copy link
Contributor

Style guide says binary operators (~ in this case) should have space around.

Other than that, LGTM

@JackStouffer
Copy link
Contributor Author

Ping @klickverbot @wilzbach

1 similar comment
@JackStouffer
Copy link
Contributor Author

Ping @klickverbot @wilzbach

@JackStouffer
Copy link
Contributor Author

Ping @wilzbach @quickfur.

Copy link
Member

@schveiguy schveiguy left a comment

Choose a reason for hiding this comment

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

Seems fine to me.

@dlang-bot dlang-bot merged commit 540e143 into dlang:master Apr 28, 2017
@JackStouffer
Copy link
Contributor Author

Thanks

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.

6 participants