Skip to content

Commit

Permalink
fix weird compiler error of std.numeric.entropy
Browse files Browse the repository at this point in the history
  • Loading branch information
wilzbach committed Jul 27, 2016
1 parent f14f0df commit 11b4c1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ script:
# test code coverage
- (cd dmd && make -f posix.mak)
- (cd druntime && make -f posix.mak)
- (cd phobos && make -f posix.mak $(find std etc -name "*.d" | sed "s/[.]d$/.test/" | grep -vE '(std.encoding|net.curl)' ))
- (cd phobos && make -f posix.mak $(find std etc -name "*.d" | sed "s/[.]d$/.test/" | grep -vE '(std.algorithm.sorting|std.encoding|net.curl)' ))
after_success:
- (cd phobos && bash <(curl -s https://codecov.io/bash))
12 changes: 6 additions & 6 deletions std/numeric.d
Original file line number Diff line number Diff line change
Expand Up @@ -1923,10 +1923,10 @@ result is greater than or equal to $(D max).
ElementType!Range entropy(Range)(Range r) if (isInputRange!Range)
{
Unqual!(typeof(return)) result = 0.0;
foreach (e; r)
for (;!r.empty; r.popFront)
{
if (!e) continue;
result -= e * log2(e);
if (!r.front) continue;
result -= r.front * log2(r.front);
}
return result;
}
Expand All @@ -1937,10 +1937,10 @@ if (isInputRange!Range &&
!is(CommonType!(ElementType!Range, F) == void))
{
Unqual!(typeof(return)) result = 0.0;
foreach (e; r)
for (;!r.empty; r.popFront)
{
if (!e) continue;
result -= e * log2(e);
if (!r.front) continue;
result -= r.front * log2(r.front);
if (result >= max) break;
}
return result;
Expand Down

0 comments on commit 11b4c1f

Please sign in to comment.