Commit graph

647 commits

Author SHA1 Message Date
Jacob Carlborg
83adbc3079
Revert "findSplit: return named tuples instead of an anonymous tuple" 2018-01-27 16:23:24 +01:00
Andrei Alexandrescu
ee034e203a
Merge pull request #5596 from wilzbach/substitute
Add substitute for lazy replacements
2018-01-25 22:25:53 -05:00
Sebastian Wilzbach
15835daa7c Fix DAutotest 2018-01-25 09:32:54 +01:00
Sebastian Wilzbach
33cf85fdb4 Address review 2018-01-25 09:30:33 +01:00
Sebastian Wilzbach
41d158f4c7 Add substitute for lazy replacements 2018-01-25 09:30:33 +01:00
Andrei Alexandrescu
2174695151
Merge pull request #6056 from n8sh/algorithm-cmp
Fix Issue 18280 - std.algorithm.comparison.cmp for non-strings should call opCmp only once per item pair
2018-01-24 13:05:24 -05:00
The Dlang Bot
c07b09e214
Merge pull request #5968 from wilzbach/searching-findSplit
findSplit: return named tuples instead of an anonymous tuple
merged-on-behalf-of: Jack Stouffer <jack@jackstouffer.com>
2018-01-24 17:10:43 +01:00
Nathan Sashihara
7f59e5ad52 Fix Issue 18280 - std.algorithm.comparison.cmp for non-strings should call opCmp only once per item pair
split cmp into two overloads per @andralex

https://github.com/dlang/phobos/pull/6056#pullrequestreview-90687092

Minor adjustments, again

cmp should return auto and let opCmp drive

https://github.com/dlang/phobos/pull/6056#issuecomment-359665184

Fix Issue 18285 - std.algorithm.comparison.cmp for strings with custom predicate compares lengths wrong

Test std.algorithm.comparison.cmp when opCmp returns float

Promotions should not use cast

Optimize cmp's endgame

There are some redundant tests when the end of the ranges is reached. Eliminated that, and improved threeWayByPred.

Fix Issue 18286 - std.algorithm.comparison.cmp for string with custom predicate fails if distinct chars can compare equal

Fix Issue 18288 - std.algorithm.comparison.cmp for wide strings should be @safe

re-apply remove cast in promotions
2018-01-23 19:54:58 -05:00
Sebastian Wilzbach
651c30207e std.algorithm.searching.findSplit returns a named tuple
- `std.algorithm.searching.findSplit`
- `std.algorithm.searching.findSplitBefore`
- `std.algorithm.searching.findSplitAfter`

will return a named tuple tuple instead of an anonymous tuple:
2018-01-17 12:50:00 +01:00
The Dlang Bot
fa0a6192a1
Merge pull request #5951 from acehreli/TaskPool_fold
Fix Issue 18096 - Add fold() to std.parallelism
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
2018-01-17 06:05:48 +01:00
The Dlang Bot
17fbc92d59
Merge pull request #6032 from RazvanN7/Issue_18230
Fix Issue 18230 - multiwayUnion sets wrong pred lambdas
merged-on-behalf-of: Andrei Alexandrescu <andralex@users.noreply.github.com>
2018-01-16 23:10:54 +01:00
Andrei Alexandrescu
6465d6ea5a
Add duplicates to test data 2018-01-16 12:10:13 -05:00
Andrei Alexandrescu
1ed73fa969
Use UFCS throughout 2018-01-16 12:09:24 -05:00
Martin Nowak
3a8300a9f6 Merge remote-tracking branch 'upstream/stable' into merge_stable 2018-01-16 04:59:35 +01:00
growlercab
347b5a3164 Update searching.d
Minor change to minElement example to remove ambiguity between min element value and min element index.
2018-01-16 02:02:31 +01:00
RazvanN7
a4cd3a6542 Fix Issue 18230 - multiwayUnion sets wrong pred lambdas 2018-01-15 16:07:18 +02:00
The Dlang Bot
f3189822ab
Merge pull request #5989 from wilzbach/static-foreach
Use static foreach in Phobos
merged-on-behalf-of: Andrei Alexandrescu <andralex@users.noreply.github.com>
2018-01-03 19:05:07 +01:00
Sebastian Wilzbach
7de3787876 Use static foreach in Phobos 2018-01-03 17:30:11 +01:00
The Dlang Bot
db2d2413b4
Merge pull request #5970 from wilzbach/markdownify-algorithm
Markdownify std.algorithm
merged-on-behalf-of: Jack Stouffer <jack@jackstouffer.com>
2018-01-03 15:44:56 +01:00
The Dlang Bot
5c37fa2046
Merge pull request #5985 from wilzbach/small-safe-2
@safeify more unittests II
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
2018-01-03 10:39:35 +01:00
Sebastian Wilzbach
b0575c8a66 @safeify more unittests II 2018-01-03 06:26:05 +01:00
Martin Nowak
ac821be1de Merge remote-tracking branch 'upstream/stable' into merge_stable 2017-12-30 19:15:43 +01:00
Dragos Carp
2b5d643337 Fix 'among' doc link in std.algorithm.searching 2017-12-30 02:23:32 +01:00
Ali Çehreli
fec204ead8 Merge branch 'master' of github.com:dlang/phobos into TaskPool_fold 2017-12-28 22:53:51 -08:00
Sebastian Wilzbach
8227e00cd9 Manual fixup 2017-12-29 01:48:45 +01:00
Sebastian Wilzbach
fc0c29f3a2 Markdownify std.algorithm
Done with: https://github.com/wilzbach/dscanner-fix/blob/master/d_code_markdown.d
2017-12-29 01:17:40 +01:00
Sebastian Wilzbach
415728e086 Remove std.stdio debug output 2017-12-29 00:20:07 +01:00
Sebastian Wilzbach
1d02ff4877 Fix typo 2017-12-29 00:19:59 +01:00
Ali Çehreli
0074d24c6a Fix a couple of tuple links 2017-12-26 22:40:48 -08:00
Johan Engelen
fd009c7434
Expand topN testcase
Passing the comparison operation as string "a < b" is tested a few lines up. This adds a test for passing a lambda function.
2017-12-15 00:18:25 +01:00
Johan Engelen
acb4c7838c
Fix intentional discarding of return value in topN
This fixes a warning one gets when compiling with warnings enabled:
"phobos/std/algorithm/sorting.d(3122): Warning: calling testcase.foo.__lambda1 without side effects discards return value of type bool, prepend a cast(void) if intentional"

Testcase that fails compilation with `-w`:
```
import std.algorithm.sorting;

auto foo() {
    int[] v = [ 25, 7, 9, 2, 0, 5, 21 ];
    return topN!((a, b) => a > b)(v, 100);
}
```
2017-12-15 00:10:49 +01:00
Sebastian Wilzbach
60fba5706d
Merge pull request #5576 from wilzbach/algo-skipover
[RFC] Make std.algorithm.searching.skipOver an eponymous template to allow partial instantiation
2017-12-02 14:31:26 +01:00
Sebastian Wilzbach
2591b61b4f Start removing std.{json,zip,zlib,algorithm.mutation}
from the assert_without_msg blacklist
2017-12-01 09:28:05 +01:00
The Dlang Bot
eb3c39048a
Merge pull request #3892 from JackStouffer/mean
Add mean to std.numeric
merged-on-behalf-of: unknown
2017-11-22 05:18:03 +01:00
Jack Stouffer
b5572e8f31 Fix issue 14034: Add mean to Phobos 2017-11-21 18:23:12 -05:00
Martin Nowak
4024b1250d Merge remote-tracking branch 'upstream/stable' into merge_stable 2017-11-21 14:10:41 +01:00
The Dlang Bot
5b7ceffa05
Merge pull request #5869 from wilzbach/do-body
Replace `body` keyword with its replacement: `do`
merged-on-behalf-of: Andrei Alexandrescu <andralex@users.noreply.github.com>
2017-11-20 17:20:16 +01:00
The Dlang Bot
d15447fb44
Merge pull request #5147 from wilzbach/static_if_std_algorithm_comparison
[Static if] Replace overload constraints with static if (comparison.d)
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
2017-11-20 16:41:02 +01:00
Sebastian Wilzbach
df6365092a Replace body keyword with its replacement: do
Automatic replacement with

    sed -i "s/^\([ ]*\)body/\1do/" -i **/*.d
2017-11-20 15:33:52 +01:00
Sebastian Wilzbach
97a2c88175 Move public unittest below their respective declaration 2017-11-20 14:17:41 +01:00
Sebastian Wilzbach
171e81d689 [Static if] static_if_std_algorithm_comparison 2017-11-20 13:51:05 +01:00
MetaLang
67e853607e
More precisely define what this overload returns 2017-11-19 00:33:35 -04:00
MetaLang
dd70c998f7
Change comment as requested by Andrei 2017-11-19 00:31:13 -04:00
Sebastian Wilzbach
42236b711d Provide pred-only overload to std.algorithm.searching.findSkip 2017-11-17 17:45:46 +01:00
aG0aep6G
d2aad6b7e6
remove unintended highlighting from cache's docs
Fixes two links.
2017-11-13 23:37:45 +01:00
The Dlang Bot
4e71185e99
Merge pull request #5796 from jondegenhardt/splitter-doc-changes
Documentation improvements for std.algorithm.splitter.
merged-on-behalf-of: Jonathan M Davis <jmdavis@users.noreply.github.com>
2017-11-11 08:28:49 +01:00
Jon Degenhardt
913a0527cd Switch from dot delimiter to avoid style check involving consecutive dots. 2017-11-10 22:31:44 -08:00
Andrei Alexandrescu
334d4b9c8c
$(LREF reduce) -> $(LREF _reduce) 2017-11-06 14:27:35 -05:00
Jon Degenhardt
a184b26e8d Documentation improvements for std.algorithm.splitter. 2017-10-31 22:47:40 -07:00
Martin Nowak
a34a25ead9 fix Issue 17730 - move escapes scope variable in @safe code
- needs to be annotated with return scope, so that the return value
  lifetime depends on the argument's lifetime
- cannot be tested because phobos doesn't yet work with DIP1000 and
  also because of Issue 17932
2017-10-23 22:10:19 +02:00