Commit graph

309 commits

Author SHA1 Message Date
Sebastian Wilzbach
8b60ec24b0 add external imports to documented unittests in std.algorithm 2016-06-15 03:42:28 +02:00
Steven Schveighoffer
c5bb43ce54 Merge pull request #4425 from JackStouffer/issue16073
Partial Fix for Issue 16073 (part 2)
2016-06-14 11:01:59 -04:00
Jack Stouffer
94d74ac8f5 [Issue 16073] Fix incorrect uses of random access range primitives in std.algorithm.sorting 2016-06-14 10:04:01 -04:00
Dmitry Olshansky
6dc8e467b0 Merge pull request #4415 from WalterBright/safeSchwartz
make the Schwartz @safe
2016-06-10 21:10:00 +04:00
Walter Bright
a85f48a85b Merge pull request #4394 from JackStouffer/equal
Added auto-decoding special case to std.algorithm.comparison.equal
2016-06-07 10:44:27 -07:00
Jack Stouffer
cb073a2cc9 Added auto-decoding special case to std.algorithm.comparison.equal 2016-06-07 09:07:59 -04:00
Walter Bright
23613c2189 make the Schwartz @safe 2016-06-07 04:19:06 -07:00
Sebastian Wilzbach
823203fc4f fix slipped through style violations 2016-06-05 01:30:55 +02:00
Vladimir Panteleev
28a7775fe4 Merge pull request #4395 from s-ludwig/master
Use REF_ALTTEXT for overview table symbol links. See issue 14403.
2016-06-03 13:22:58 +03:00
Andreas Zwinkau
9d77777941 Removed outdated comment
Slipped through pull request #4362. Since "above" is a different
algorithm the removed comment is misleading. It did make sense in
previous versions of PR #4362.
2016-06-02 22:59:40 +02:00
Sönke Ludwig
e43ac92e69 Use REF_ALTTEXT for overview table symbol links. See issue 14403. 2016-06-02 22:11:11 +02:00
Andreas Zwinkau
a9d5b8ca77 Improve speed of find for random access needles (strings)
For find a string within a string, std.algorithm.searching.find was
unnecessarily slow. The reason is it created intermediate slices. A
naively written nested-for-loop implementation was a few times
faster.

For random access ranges (which strings are) this uses an index based
algorithm, which does not need to create an intermediate slice. Speed
is now comparable to the nested-for-loop implementation even in rather
pathological cases.

This might help with issue 9646.
2016-06-02 21:44:50 +02:00
Steven Schveighoffer
e216c10b2c Merge pull request #4383 from JackStouffer/issue16073
Partial Fix for Issue 16073
2016-06-02 14:30:24 -04:00
Jack Stouffer
74398e70cf [Issue 16073] Fix incorrect uses of random access range primitives in std.algorithm.searching 2016-06-02 09:31:07 -04:00
Jack Stouffer
3a1db06f41 [Issue 16073] Fix incorrect uses of random access range primitives in std.algorithm.mutation 2016-06-02 09:31:06 -04:00
Jack Stouffer
a818c7e059 [Issue 16073] Fix incorrect uses of random access range primitives in std.algorithm.iteration 2016-06-02 09:31:01 -04:00
Sebastian Wilzbach
ca098c57d2 manual allman brace fixup 2016-05-31 13:07:53 +02:00
Sebastian Wilzbach
1d34a121e9 apply all-man braces in Phobos
// find common cases
sed -E "s/^(\s*)((if|static if|for|foreach|foreach_reverse|while|unittest|switch|else|version).*)\s*\{$/\1\2\n\1{/" -i **/*.d
// catch else-if
sed -E "s/^(\s*)} (else static if| if|else if|else)(.*)\s*\{$/\1}\n\1\2\3\n\1{/" -i **/*.d
// remove created trailing whitespace
sed -i 's/[ \t]*$//' **/*.d
2016-05-31 13:07:53 +02:00
Sebastian Wilzbach
2dfbc51f17 Standardize whitespace after imports
Unified with:

sed -E "s/import\s*([^ ]+)\s*:\s*(.*(,|;))/import \1 : \2/" -i **/*.d
2016-05-29 22:09:56 +02:00
anonymous
641d6ff8d7 clean up remaining XREFs (manual)
Found by: grep -r '$(XREF'

std.experimental.allocator has a custom XREF2. Leaving that as is for now.
2016-05-27 21:40:46 +02:00
anonymous
ef9722928c XREF_PACK_NAMED -> REF_ALTTEXT (sed)
Done by:

arg='\s*([^(),]*)'
from='\$\(XREF_PACK_NAMED\s'$arg','$arg','$arg','$arg'\)'
to='$(REF_ALTTEXT \4, \3, std,\1,\2)'
(find . -type f -name "*.d" -print0; \
    find . -type f -name "*.dd" -print0) | \
xargs -0 sed -i -r "s/$from/$to/g"
2016-05-27 21:32:46 +02:00
anonymous
d648f9320e XREF_PACK -> REF (sed)
Done by:

from='\$\(XREF_PACK\s+([^(),]*),\s*([^(),]*),\s*([^(),]*)\)'
to='$(REF \3, std,\1,\2)'
(find . -type f -name "*.d" -print0; \
    find . -type f -name "*.dd" -print0) | \
xargs -0 sed -i -r "s/$from/$to/g"
2016-05-27 21:32:46 +02:00
anonymous
764caefa36 XREF -> REF (sed)
Done by:

(find . -type f -name "*.d" -print0; \
    find . -type f -name "*.dd" -print0) | \
xargs -0 sed -i -r \
    's/\$\(XREF\s+([^(),]*),\s*([^(),]*)\)/$(REF \2, std,\1)/g'
2016-05-27 21:32:46 +02:00
Dmitry Olshansky
2c0b7d24e3 Merge pull request #4354 from wilzbach/newlines_algorithm
remove whitespace in ddoc output of std/algorithm
2016-05-27 14:37:26 +04:00
Sebastian Wilzbach
18b8abf60a remove the deprecated wiki macros 2016-05-27 05:52:23 +02:00
Sebastian Wilzbach
614294cd70 remove whitespace in ddoc output of std/algorithm 2016-05-25 03:57:01 +02:00
Andrei Alexandrescu
8f24656082 Merge pull request #4349 from nordlow/findSplit-opAssign
Fix Issue 15918
2016-05-24 09:04:48 -04:00
Per Nordlöw
54f05971e4 Fix Issue 15918 2016-05-24 09:37:36 +02:00
Vladimir Panteleev
38a6370788 Merge pull request #4303 from wilzbach/mref_phobos
use mref macro instead of link2
2016-05-24 03:12:08 +03:00
Robert Schadek
836a905833 Merge pull request #4312 from wilzbach/public_document_algorithms
std.algorithms: document public methods
2016-05-23 19:15:23 +02:00
Sebastian Wilzbach
89a2dd5f11 use mref macro instead of link2 2016-05-16 03:30:08 +03:00
Ilya Yaroshenko
b59ac8c2a8 remove useless CT branch 2016-05-12 17:29:49 +02:00
Sebastian Wilzbach
b8f17e2531 std.algorithms: document public methods 2016-05-12 17:53:03 +03:00
Jack Stouffer
3890f5d804 Fixed long lines in std/algorithm/iteration.d 2016-05-10 20:51:39 -04:00
Ryan Roden-Corrent
ed03b22bc0 Support multi-arg opApply/range for each.
std.algorithm.iteration.each can now be called with a lambda taking >2
args. This should work for any input range that returns a tuple and any
type with a non-templated opApply that takes a multi-arg delegate.

Determining the arity of a templated opApply still poses a problem, so
that case is not supported.

This also adds support for `each` with two ref args.

When given a binary function that takes two args by ref,
std.algorithm.iteration.each should use both args by ref.

It was previously discarding ref on the first arg, assuming it was for
an index.

Resolves #15358.
2016-05-08 07:22:48 -04:00
Martin Nowak
72fdea91e0 Merge pull request #4235 from wilzbach/multisort_with_pred
Fix issue 10777 - multiSort should return a SortedRange
2016-05-06 00:43:56 +02:00
anonymous
4a28601977 rewrap 2016-04-30 20:30:16 +02:00
anonymous
f46e52b4f2 documentation: fix requirements of remove
All overloads require a bidirectional range with lvalue elements.
2016-04-30 20:26:34 +02:00
Sebastian Wilzbach
6b165d4deb Fix issue 10777 - multiSort should return a SortedRange 2016-04-30 12:38:27 +03:00
Dmitry Olshansky
85f9e816da Merge pull request #3972 from dcarp/std_algorithm_iteration_scan
Add std.algorithm.iteration.cumulativeFold
2016-04-29 16:18:55 +04:00
Sebastian Wilzbach
cc5e36d1b4 std.algorithm.searching - fix weird bug in Travis 2016-04-28 17:30:05 +03:00
Dmitry Olshansky
18dfffa07d Merge pull request #4221 from wilzbach/min_max_element
std.algorithm: {min,max}Element for a single range
2016-04-28 17:13:24 +04:00
Dragos Carp
984fbb487d Address review comments 2016-04-27 22:12:33 +02:00
Dragos Carp
5a9cedf1bd Add std.algorithm.iteration.cumulativeFold 2016-04-27 22:12:32 +02:00
Dmitry Olshansky
c1027f1970 Merge pull request #4246 from wilzbach/sed_spaces_part_2
style fix: add space after 'for' operator
2016-04-27 16:17:18 +04:00
Sebastian Wilzbach
e3d0aa9724 std.algorithm: {min,max}Element for a single range 2016-04-27 04:40:11 +03:00
Brian Schott
6a349b32ca Merge pull request #4238 from 9il/swap
Trivial. clean imports in sorting
2016-04-26 17:11:52 -07:00
Sebastian Wilzbach
5a8988c149 style fix: add space after for operator 2016-04-27 02:04:02 +03:00
Sebastian Wilzbach
3d67cd228c style fix: space between operators 2016-04-26 22:26:20 +03:00
Ilya Yaroshenko
f5f0fa5cd6 clean imports in sorting 2016-04-26 17:07:30 +02:00