Commit graph

953 commits

Author SHA1 Message Date
Ate Eskola
eea0174127 Extra commenting on postblits, and removed needless trusted lambda 2021-08-30 16:14:53 +03:00
Ate Eskola
41355cd4e3 Partially solve issue 18161. splitWhen and chunkBy when using forward ranges is now safe 2021-08-25 22:52:40 +03:00
vladchicos
bbfe30a671 Add clarifications 2021-08-12 05:09:14 +03:00
vladchicos
cba0b3f813 Added more unittests 2021-08-12 05:09:14 +03:00
vladchicos
7a715fe687 Fix for popBack/popFront
popBack/popFront works for RoRs starting and/or ending with empty items
2021-08-12 05:09:14 +03:00
vladchicos
e32b635f05 Added more unittests 2021-08-12 05:09:14 +03:00
vladchicos
68dab0e2e5 Fix Issue 19727 - std.algorithm.endsWith fails to compile while startsWith succeeds. 2021-08-12 05:09:14 +03:00
Walter Bright
3301a20c16 fix Issue 22146 - std.algorithm.searching.findAdjacent() can fall off end of function 2021-07-26 14:37:43 +00:00
dkorpel
9ec24190b1 add explicit scope/return for pure functions 2021-07-11 13:34:25 +00:00
Walter Bright
ef28dede87
specialize max/min for common case (#7499)
specialize max/min for common case

Signed-off-by: Razvan Nitu <RazvanN7@users.noreply.github.com>
Merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
2021-07-09 13:20:43 +00:00
João Lourenço
882cf3df43
std.algorithm: improve findSplit methods module documentation
Signed-off-by: João Lourenço <jlourenco5691@gmail.com>
2021-06-07 12:07:47 +01:00
nordlow
5d31a68082 Break line to please maximum line length enforced by style checker 2021-05-17 12:04:06 +02:00
nordlow
6bef53dd1a Annotate std/algorithm/searching.d to please dlang/dmd#12520 #8076 2021-05-17 00:02:04 +02:00
Nathan Sashihara
edd9007c35 Fix Issue 21724 - std.algorithm.mutation.copy fails on overlapping arrays if the source array's pointer is less than the destination array's pointer 2021-04-25 20:43:24 +08:00
Nathan Sashihara
a23fa4ed06 Fix issue #21702 - avoid quadratic template expansion in constraints of multiple search term versions of std.algorithm.searching.startsWith & endsWith 2021-04-25 20:43:24 +08:00
Nathan Sashihara
a5e0d8c17b Remove unnecessary threeWayCompareLength from cmp 2021-04-24 04:15:53 +02:00
berni44
b2019ebab0 Narrow imports of std.math in the rest of phobos. 2021-04-21 03:00:57 +02:00
Robert Aron
d8f3d3a815 Add splitter functionality that allows to keep the sentinels
Signed-off-by: Robert Aron <aronrobert293@gmail.com>

Update the Return: section of DDoc

Fix whitespace
2021-04-21 00:33:22 +02:00
Arne
8c42ec9d8a
Check for sortedness must not use == (#7928)
Check for sortedness must not use `==`
merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
2021-04-14 17:58:11 +02:00
Nick Treleaven
899601aa35 Fix assigning size_t to int for "a=i" 2021-03-19 16:18:29 +00:00
Nick Treleaven
18a647bed4 Add separate example for each with index
Remove doc-comment for example that wasn't as clear.
2021-03-19 14:14:09 +00:00
Nick Treleaven
1af0e4d5e9 std.algorithm: tweak each examples
Make first example @safe.
Split opApply example into separate block.
2021-03-19 14:08:37 +00:00
Ate Eskola
d944ca79a5
Fix Issue 13595 - added splitWhen (#7794)
Fix Issue 13595 - added splitWhen
merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
2021-03-18 15:27:34 +01:00
Paul Backus
f94815142a Fix incorrect usage of "verify" in docs
Other documentation in std.algorithm.searching consistently uses
"satisfy" for predicates.
2021-03-10 11:23:28 -05:00
Paul Backus
97fe720085 Document result of 'all' and 'any' on empty range 2021-03-10 11:21:24 -05:00
dkorpel
853e667034 improve documentation of std.algorithm.sorting 2021-03-03 01:05:36 +01:00
Razvan Nitu
44e47a03d2
Merge pull request #7807 from BorisCarvajal/bug21651_changes
Remove a few uses of fully qualified names that rely on a DMD bug
2021-02-23 00:33:17 +08:00
Boris Carvajal
276053dd07
Remove a few uses of fully qualified names that rely on a DMD bug 2021-02-22 08:16:13 -03:00
Bastiaan Veelo
e2a2c54927
Fix copy-paste error in documentation. 2021-02-22 11:15:05 +01:00
Bernhard Seckinger
9cb7755041 Replace approxEqual with isClose 2021-01-28 10:39:50 +01:00
Martin Kinkelin
1a459c5996 Get rid of std.conv.emplace[Ref](), use core[.internal].lifetime
The emplace() stuff was moved to druntime; for some reason, it's still
in Phobos.

I've diffed the two versions, and they are still almost identical (incl.
unittests); the druntime version appears to have seen some improvements
(e.g., forwarding r/lvalueness of the arguments) in the meantime.
2021-01-17 16:02:25 +01:00
Geod24
b6a9cd8c64 Fix broken link in minElement doc 2020-11-28 20:37:54 +01:00
The Dlang Bot
4d7e5829cb
Merge pull request #7625 from jamesragray/chunkbyfix
Issue 14909: Provided a fix for the forward range version of chunkBy …
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2020-09-23 03:05:14 +02:00
Andrei Alexandrescu
71ff9d79c5 EASY: factor implementations of range length into a mixin template 2020-09-20 02:38:14 +02:00
Andrei Alexandrescu
311f00f8ac
Merge pull request #7632 from andralex/minmax
Simplify min and max
2020-09-19 16:19:07 -04:00
Andrei Alexandrescu
620a5a042d Push useCodePoint all the way in 2020-09-18 10:43:27 -04:00
Andrei Alexandrescu
e048dbeb18 Review 2020-09-18 10:43:27 -04:00
Andrei Alexandrescu
369ed6edb6 No need for isEmptyRange 2020-09-18 10:42:03 -04:00
Andrei Alexandrescu
890cd7e8b7 A few more minor improvements to std.algorithm.comparison: pushed implementation constraint down, undocument superfluous flag name, allow comparison of lengths involving infinite ranges, simplify implementation of isSameLength 2020-09-18 10:42:03 -04:00
Andrei Alexandrescu
cae6379750 Fix Issue 21249 - clamp() is not stable and is not constrained 2020-09-16 01:20:51 +02:00
Andrei Alexandrescu
639bedbea8 Fix min 2020-09-13 17:25:20 -04:00
Andrei Alexandrescu
43c95c46d8 Improve type computation - a type that defines max could mess things up 2020-09-13 16:43:42 -04:00
Andrei Alexandrescu
423f633fd7 Simplify min and max 2020-09-13 10:47:18 -04:00
James Gray
40286ea15d Fixed several style problems 2020-09-11 15:26:35 +02:00
James Gray
e32356385e Fixed trailing whitespace at line 2129 of std/algorithm/iteration.d 2020-09-11 15:11:50 +02:00
James Gray
2ed6952a71 Issue 14909: Provided a fix for the forward range version of chunkBy so that it can accept predicates refernce variables in the calling function 2020-09-10 20:42:17 +02:00
Martin Nowak
498b4b97d6 Merge remote-tracking branch 'upstream/master' into stable
Conflicts:
	posix.mak
2020-09-09 10:18:21 +02:00
Andrei Alexandrescu
6194b17295 Fix Issue 21191 - min should be stable: when in doubt, return the first argument 2020-08-28 08:19:40 +02:00
MoonlightSentinel
255f9496d1
Fix Issue 21183 - schwartzSort does not strip const
Fixed by using the unqualified type if possible
2020-08-21 15:06:11 +02:00
Steven Schveighoffer
17ae8fc9be Make it so std.utf can be tested with no autodecoding. 2020-08-17 06:53:34 +02:00