Conversation
src/analysis/useless_assert.d
Outdated
| { | ||
| case tok!"doubleLiteral": | ||
| if (!token.text.removechars("Ll").to!double) | ||
| if (!token.text.asLowerCase.filter!(c => c != 'l').to!double) |
There was a problem hiding this comment.
I think the following may be shorter/faster:
auto filterChars(string chars, S)(S str)
{
import std.algorithm.comparison : among;
import std.algorithm.iteration : filter;
import std.meta : aliasSeqOf;
return str.filter!(c => !c.among(aliasSeqOf!chars));
}
if (!token.text.filterChars!"Ll".to!double)
// ...
PetarKirov
left a comment
There was a problem hiding this comment.
Aprart from my suggestion, LGTM.
5713c57 to
9c36821
Compare
Yes, that's very elegant! |
|
(Don't mind my stupid ws commits, I'll squash them out of existance as soon as the tests pass ;) ) |
No worries, I also made the same mistake here. Setting up a |
Ah yes, I have done so ages ago, but sometimes I'm too lazy and I edit PRs with the GitHub online editor.
I noticed, but I can't make sense of the error - I don't think it should be there. Anyway, I think we should also bring emsi_containers to the org, so we can more easily manage such issues. |
It was introduced here: dlang/dmd#6816
That's a great idea -> https://github.com/economicmodeling/containers/issues/81 |
They were getting annoying ;-)