Commit graph

391 commits

Author SHA1 Message Date
David Nadlinger
cf3134e01c sorting: Avoid using $ on generic ranges
It is not guaranteed to exist even if hasLength is true.
2016-10-22 15:17:07 +01:00
Andrei Alexandrescu
9ad4f0d227 Fix safety checks 2016-10-22 09:20:56 -04:00
Andrei Alexandrescu
9778872ffa Better safety checks 2016-10-21 13:21:41 -04:00
Andrei Alexandrescu
9a8bf131d9 Fix @safe checks 2016-10-21 13:21:41 -04:00
Andrei Alexandrescu
3156509175 Print rng seed upon failure so test can be reproduced 2016-10-21 13:21:41 -04:00
Andrei Alexandrescu
f19c92a1bf topN rewrite 2016-10-21 13:21:41 -04:00
Sebastian Wilzbach
2090d3300d Merge pull request #4842 from ntrel/findSplit-only
[trivial] Add findSplitBefore example with an element using only()
2016-10-14 08:50:56 +02:00
Martin Nowak
74486fee21 Merge remote-tracking branch 'upstream/stable' into merge_stable 2016-10-09 15:00:31 +02:00
Nick Treleaven
ae6a8031cf Add findSplitBefore example with an element using only()
Also remove typo.
2016-10-06 12:05:03 +01:00
Vladimir Panteleev
d6572c2a44 Fix Issue 16587 - split("", "x") should be ""
This reverts commit b438bf5a06.
2016-10-03 22:30:00 +00:00
David Nadlinger
bf61ad682f Merge pull request #4826 from andralex/6192-redivivus
Use medianOf 3 and 5 to estimate pivot
2016-10-01 14:41:56 +01:00
Andrei Alexandrescu
2f8e693e5d Merge pull request #4814 from e-y-e/fixflags
[trivial] [large diff] Update uses of Flag to use the Yes/No structs.
2016-09-30 18:25:44 -04:00
Andrei Alexandrescu
26f47b1e2e Watermarks slightly different for debug vs release 2016-09-30 17:44:38 -04:00
Andrei Alexandrescu
3cb9e4d821 Use medianOf 3 and 5 to estimate pivot 2016-09-30 16:10:40 -04:00
Walter Bright
c5f289156e Merge pull request #4809 from andralex/pivotPartition
Add pivotPartition
2016-09-30 12:09:39 -07:00
Andrei Alexandrescu
b2978040ca Merge pull request #4429 from JackStouffer/issue16170
[Issue 16170] Partial Fix for Broken std.algorithm.sorting.partition
2016-09-30 11:43:19 -04:00
Jack Stouffer
e21f2729ba [Issue 16170] Seperate std.algorithm.sorting.partition into various overloads in order to facilitate further improvements 2016-09-30 15:16:36 +01:00
Andrei Alexandrescu
a9b7fb0313 Add back the entropy following dmd bug fix 2016-09-30 09:13:30 -04:00
Andrei Alexandrescu
d5e2b607d7 Fix dox 2016-09-30 09:08:01 -04:00
Andrei Alexandrescu
63f9713feb Add some dox 2016-09-30 09:08:01 -04:00
Andrei Alexandrescu
40df929b37 Add pivotPartition 2016-09-30 09:08:01 -04:00
Andrei Alexandrescu
25dac83dbc medianOf restricted for now to only size_t indexes 2016-09-29 18:45:42 -04:00
Andrei Alexandrescu
1859f0dc19 Make medianOf private for now to have freedom in choosing a public spec later 2016-09-29 16:22:21 -04:00
Andrei Alexandrescu
0a967579bb @wilzbach review 2016-09-29 16:21:04 -04:00
Andrei Alexandrescu
15ee49f84f Review 2016-09-29 16:21:04 -04:00
Andrei Alexandrescu
dcd00a7609 Add medianOf 2016-09-29 16:20:11 -04:00
e-y-e
befa0bfb6e Updated Flag uses to Yes/No structs 2016-09-29 14:45:20 +01:00
Andrei Alexandrescu
a4393248ba Tighter loop for insertion sorting 2016-09-25 18:13:58 +02:00
Martin Nowak
97f58eac9d don't preincrement j index to match else branch
- was confusing to use different index flavours for the 2 "memmoves"
2016-09-25 11:51:53 +02:00
Martin Nowak
a0eec9d86b dedicated sort5 unittest
- test all permutations of 5 integers
- remove scope success assertion in sort5
- move shortSort test below shortSort as it now tests only one function
2016-09-25 11:26:16 +02:00
Martin Nowak
5901459850 replace a-e indices w/ 0-4 2016-09-25 11:12:39 +02:00
Andrei Alexandrescu
56f511c020 Workaround for https://issues.dlang.org/show_bug.cgi?id=16534 2016-09-24 11:46:47 -04:00
Andrei Alexandrescu
9e84e1a247 Optimized sort, 4%-8% speed improvements 2016-09-24 11:10:42 -04:00
e-y-e
669fa67b1d Change yes/no enum SortOutput to a Flag 2016-09-23 10:32:43 +01:00
e-y-e
ad2563f8e7 Change yes/no enum OpenRight to a Flag 2016-09-23 10:08:46 +01:00
Jack Stouffer
67d44e4cdc Remove package wide std.algorithm imports from Phobos 2016-09-22 08:36:14 +01:00
Andrei Alexandrescu
bb24012402 Merge pull request #4776 from NVolcz/patch-3
Added usage example to equal
2016-09-16 19:32:06 -04:00
Andrei Alexandrescu
288c21b78b Merge pull request #4775 from NVolcz/patch-2
Removed debug lines from example unittest
2016-09-16 19:28:22 -04:00
Walter Bright
55e5737525 add 'scope' to opApply() parameter 2016-09-14 19:41:41 -07:00
NVolcz
3c06aae6e5 Added usage example to equal 2016-09-12 15:49:26 +02:00
NVolcz
afc7ae9bb3 Removed debug lines from example unittest
The example for ´´´auto joiner(RoR)(RoR r)´´´ includes a scoped debug line. This line is not relevant in an example unittest.
https://dlang.org/phobos/std_algorithm_iteration.html#joiner
2016-09-12 11:22:26 +02:00
Walter Bright
9cfe39bfe2 searching.d: add scope annotations 2016-09-06 02:33:12 -07:00
Andrei Alexandrescu
5c5dda3dfb Merge pull request #4249 from wilzbach/fix_15960
fix issue 15960 - deprecate setUnion in favor of merge
2016-08-28 20:15:40 -04:00
Dmitry Olshansky
96b93c7b63 Merge pull request #4736 from schveiguy/fixinitializeall
Fix issue where initializeAll does not properly use initializer
2016-08-28 21:44:30 +02:00
Sebastian Wilzbach
501a1d5f41 fix issue 15960 - deprecate setUnion in favor of merge 2016-08-28 17:51:29 +02:00
John Colvin
7c7af21d48 add test for Issue 16413 2016-08-27 15:06:22 +01:00
Sebastian Wilzbach
9abe256cab Merge pull request #4740 from togrue/bugfix_16179
Fix issue 16179 - multiSort no longer callable with delegate with context
2016-08-26 21:47:54 +02:00
togrue
7f88a93227 Fixed issue 16179
(multiSort no longer callable with delegate with context)

- Moved out nested functions inside multiSort to the module scope.
- Added a unittest
2016-08-26 21:04:01 +02:00
Jack Stouffer
c5d537f06e Fix spelling mistake in iteration.d 2016-08-24 15:45:47 -04:00
Steven Schveighoffer
ea3f446a98 Fix issue where initializeAll does not properly use
TypeInfo_StaticArray.initializer. Found in issue 16394
2016-08-18 17:29:29 -04:00