Commit graph

102 commits

Author SHA1 Message Date
Sebastian Wilzbach
d9830b739e Fix DScanner warnings 2018-02-10 22:46:32 +01:00
Sebastian Wilzbach
7fb3d4249f Remove references to STL 2018-01-30 16:08:20 +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
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
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
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
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
171e81d689 [Static if] static_if_std_algorithm_comparison 2017-11-20 13:51:05 +01:00
Sebastian Wilzbach
334642bbb6 has_public_example: std.algorithm.comparison 2017-07-08 23:52:27 +02:00
Vladimir Panteleev
d0b9555a06
Revert "Sort selective imports"
This reverts commit 998ad51fd7.
2017-06-13 17:51:52 +00:00
Sebastian Wilzbach
998ad51fd7 Sort selective imports 2017-06-12 08:12:09 +02:00
Sebastian Wilzbach
61717ecc7d Sort imports 2017-06-12 07:54:38 +02:00
Jack Stouffer
b5ffc889ca Remove debug writelns 2017-06-01 11:13:04 -04:00
The Dlang Bot
8146e88326 Merge pull request #5210 from wilzbach/std-algorithm-disable-quick-index
std.algorithm: remove quickIndex, fix outdated book tables & HTML links
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
2017-03-03 15:35:24 +01:00
Sebastian Wilzbach
b3bf38e6d6 std.algorithm: remove quickIndex, fix outdated book tables & HTML links 2017-03-01 03:59:48 +01:00
Sebastian Wilzbach
d548e8830a Replace LUCKY links with actual links 2017-02-28 23:46:54 +01:00
Jack Stouffer
f2b5834172 Linked to the definition of forward and bidirectional ranges where they're mentioned in std.algorithm 2017-02-26 11:44:55 -05:00
Jack Stouffer
7d4ac19030 Linked to the definition of input ranges where they're mentioned 2017-02-25 19:18:54 -05:00
Sebastian Wilzbach
425ab667a3 Automatically set the range style from a..b -> a .. b
Commands:

sed -E "s/([[:alnum:]])[.][.]([[:alnum:]])/\1 .. \2/g" -i **/*.d
sed -E "s/([[:alnum:]])[.][.] ([[:alnum:]])/\1 .. \2/g" -i **/*.d
sed -E "s/([[:alnum:]]) [.][.]([[:alnum:]])/\1 .. \2/g" -i **/*.d
2017-02-22 05:37:31 +01:00
Sebastian Wilzbach
805c720595 Unify Phobos by ensuring there's always a space after cast(...)
Command:

sed -E 's/([^"])cast\(([^)]*?)\)([[:alnum:]])/\1cast(\2) \3/g' -i **/*.d
2017-02-21 16:40:20 +01:00
Sebastian Wilzbach
5521541032 Unify assert style to have no spaces between the first brace
Application of:

sed -E "s/assert +\(/assert(/" -i **/*.d
2017-02-21 15:27:15 +01:00
Sebastian Wilzbach
1552ed5e18 DScanner: check for useless asserts 2017-02-20 15:10:09 +01:00
Sebastian Wilzbach
87dec58a41 DStyle: Constraints on declarations should have the same indentation level 2017-02-17 07:36:23 +01:00
Sebastian Wilzbach
d1b59d3f2e Fix Issue 16135 - missing std.format import in std.algorithm.comparison 2016-12-30 08:59:25 +01:00
Sebastian Wilzbach
cc7f125ed1 Add missing imports to public unittests 2016-12-15 23:23:35 +01:00
Nick Treleaven
52a381320f Disallow known empty ranges to be compared against a range with incompatible front 2016-10-22 16:24:18 +01:00
Nick Treleaven
2a45a145e8 Fix Issue 16628 - std.algorithm.equal for known empty or infinite ranges
* If one of the ranges has `Range.empty == true`, we can define `equal`
  even when each `front` is not comparable.
* If one range is infinite and the other defines `length`, return false.
* If both are infinite, cause a compile-time error.
2016-10-20 12:27:32 +01:00
e-y-e
befa0bfb6e Updated Flag uses to Yes/No structs 2016-09-29 14:45:20 +01:00
Jack Stouffer
67d44e4cdc Remove package wide std.algorithm imports from Phobos 2016-09-22 08:36:14 +01:00
NVolcz
3c06aae6e5 Added usage example to equal 2016-09-12 15:49:26 +02:00
Andrei Alexandrescu
bf3669f369 Merge pull request #4687 from wilzbach/std_algorithm_comparison
add unittest attributes to std.algorithm.comparison
2016-08-15 05:38:44 -04:00
Walter Bright
8f69e217bf comparison.d: add overflow checks 2016-08-05 00:39:33 -07:00
Sebastian Wilzbach
bd98ca10d7 add unittest attributes to std.algorithm.comparison 2016-07-29 12:25:56 +02:00
Jack Stouffer
268fa2538d Add some const and immutable to std.algorithm 2016-07-01 17:11:09 -04:00
Sebastian Wilzbach
ec47ac4224 Remove the WEB macro in favor of HTTP
replacement: sed 's/\$(WEB/\$(HTTP/g' -i **/*.d
2016-06-16 00:14:51 +02:00
Jack Stouffer
cb073a2cc9 Added auto-decoding special case to std.algorithm.comparison.equal 2016-06-07 09:07:59 -04: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
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
Sebastian Wilzbach
614294cd70 remove whitespace in ddoc output of std/algorithm 2016-05-25 03:57:01 +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
Sebastian Wilzbach
89a2dd5f11 use mref macro instead of link2 2016-05-16 03:30:08 +03:00
Sebastian Wilzbach
b8f17e2531 std.algorithms: document public methods 2016-05-12 17:53:03 +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
Sebastian Wilzbach
e3d0aa9724 std.algorithm: {min,max}Element for a single range 2016-04-27 04:40:11 +03: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
95ea08d50b fix imports 2 2016-04-07 15:54:04 +02:00
Jakob Øvrum
22a90f904e Tweak std.algorithm.comparison.either docs and add to package doc table 2016-03-06 22:45:06 +09:00