Commit graph

321 commits

Author SHA1 Message Date
Alex Rønne Petersen
bdc959933c Merge pull request #1070 from monarchdodra/9299
Fixes issue 9299 - std.algorithm.minPos of const(int)[]
2013-01-13 16:20:56 -08:00
unknown
5afbfac8c5 Fixes issue 9299 - std.algorithm.minPos of const(int)[] 2013-01-12 14:30:25 +01:00
Andrei Alexandrescu
6996f434af Merge pull request #1009 from monarchdodra/initializeAll
improvements to uninitializedFill && initializeAll
2013-01-11 07:55:04 -08:00
monarch dodra
7db6ba8cfd whitespace 2013-01-11 16:12:27 +01:00
Alex Rønne Petersen
10d28218d8 Merge pull request #1058 from andralex/5726
Issue 5726 - boyerMooreFinder hangs when finding
2013-01-08 01:00:30 -08:00
Alex Rønne Petersen
85d2d2fc77 Merge pull request #1059 from andralex/5513
Issue 5513 - Erroneous example in std.algorithm
2013-01-08 01:00:06 -08:00
Andrei Alexandrescu
792392d30f Issue 5513 - Erroneous example in std.algorithm 2013-01-08 00:48:19 -08:00
Andrei Alexandrescu
2e2970aca2 Issue 5726 - boyerMooreFinder hangs when finding 2013-01-08 00:37:37 -08:00
jmdavis
c52a6558c2 Fix commonPrefix so that it can mix strings and other ranges.
The fix for 8890 made it so that commonPrefix could no longer compare
strings with ranges of other types. This fixes that.
2013-01-04 14:32:36 -08:00
jmdavis
545df62174 Slight tweak to commonPrefix's template constraint. 2013-01-04 14:32:36 -08:00
jmdavis
dd5eb5ff97 Fix for issue# 8890: commonPrefix does not handle unicode correctly.
It was returning partial code points if the first few code units in a
code point matched but not the entire code point.
2013-01-04 14:32:35 -08:00
H. S. Teoh
d442a0322f Explain necessity of setItem being a mixin. 2012-12-31 07:27:23 -08:00
H. S. Teoh
4e329dc4b1 Add unittests for new joiner with separator.
Comment out assert which will segfault when passed a range of class
objects, because the .init value of a class object is null, and
.init.empty is a null dereference.
2012-12-30 21:19:04 -08:00
H. S. Teoh
10afee97c4 Make joiner (with separator) work with forward ranges and transient ranges.
This is for the variant of joiner that takes a separator.

Restructure algorithm to not call .popFront while we're still using
.front.

Make sure we .save subranges when we're exporting .save, since RoR.save
does not guarantee the state of subranges are also .save'd.
2012-12-30 21:19:04 -08:00
monarch dodra
abc9b2fea6 typo 2012-12-29 17:47:49 +01:00
monarch dodra
4a7811a9dc Fix previous bug in countUntil
as pointed out by denish-sh. Also, more unittests.
2012-12-29 17:10:15 +01:00
Peter Alexander
14b7095bd8 Simplified std.algorithm.copy array overlap test.
The array overlap test in std.algorithm.copy did an unnecessary amount of comparisons. This pull request simplifies it.
2012-12-25 18:13:35 +00:00
Walter Bright
bbcd9a5d3c Merge branch 'master' of github.com:D-Programming-Language/phobos 2012-12-24 20:16:39 -08:00
Walter Bright
ef0bed7d15 fix memory corruption bug in unittest 2012-12-24 20:16:19 -08:00
Andrei Alexandrescu
58fde7057f Merge pull request #1024 from monarchdodra/countStarts
performance tweaks for countUntil
2012-12-24 09:44:02 -08:00
Andrei Alexandrescu
c1f8609e1f Merge pull request #1013 from Poita/endsWithRefactor
Refactored endsWith to use retro + startsWith.
2012-12-23 19:52:00 -08:00
unknown
f8782c37d9 performance tweaks for countUntil 2012-12-22 00:03:34 +01:00
H. S. Teoh
f687885a76 No need to use .save on inner range if we aren't going to export .save. 2012-12-20 10:20:30 -08:00
H. S. Teoh
7ff2fcec06 Fix issue 8061.
We cannot assume that RoR.save will also .save the state of its
subranges; so the only way we can correctly export a .save method in the
joined range is if we also .save its subranges as we traverse over them.
2012-12-20 10:03:43 -08:00
Andrei Alexandrescu
af12683895 Merge pull request #854 from jmdavis/hasSlicing
Improvements to hasSlicing
2012-12-17 21:38:26 -08:00
Walter Bright
3b683d99bf Merge pull request #1004 from 9rnsr/fix9060
Issue 9060 - std.range.chain and std.range.zip cannot get frame pointer
2012-12-17 21:02:38 -08:00
Alex Rønne Petersen
cc3176ab76 Merge pull request #1015 from monarchdodra/spaces
Removing trailing spaces in algorithm
2012-12-17 17:05:46 -08:00
k-hara
46b612de08 fix Issue 9060 - std.range.chain and std.range.zip cannot get frame pointer
Changes to avoid following two errors:
* "cannot access frame pointer"
* "field xxx must be initialized in constructor, because it is nested struct"
2012-12-18 09:22:24 +09:00
unknown
027804bc28 Removing trailing spaces 2012-12-17 18:54:47 +01:00
jmdavis
57ddea7cf2 Fix to Map caused by changes to hasSlicing.
import std.algorithm;
import std.range;

void main()
{
    auto N2 = sequence!"n"(cast(size_t)1).map!"a";
}

ceased to compile, because Map's opSlice won't work anymore over
infinite ranges, because the result can't be reassigned to the original.
2012-12-16 22:28:17 -08:00
jmdavis
7d5d9fb1c0 Some whitespace cleanup. 2012-12-16 22:28:16 -08:00
H. S. Teoh
3a2377ccd3 Replace joiner unittest with one that doesn't suffer from issue 9131. 2012-12-16 21:35:22 -08:00
H. S. Teoh
e471f8ee13 Completely get rid of UTF-8 to workaround OSX/64 bug. 2012-12-16 21:35:22 -08:00
H. S. Teoh
f83ad8a572 Add unittest for new joiner. 2012-12-16 21:35:22 -08:00
H. S. Teoh
d489281292 Rewrite joiner to not assume persistence of .front. 2012-12-16 21:35:22 -08:00
Peter Alexander
0c52706eb6 Refactored endsWith to use retro + startsWith.
What's the point of having all these powerful, generic, abstract functions if we're just going to copy and paste code? :-)

This change has several benefits:

* It is far more elegant.
* Changes (optimisations) to startsWith automatically carry across to endsWith.
* We get extra testing for startsWith and retro for free.
2012-12-17 02:08:39 +00:00
Hara Kenji
194ca07803 Merge pull request #1011 from blackwhale/fix-multisort
fix issue 9160 multiSort constraint regression
2012-12-16 17:34:09 -08:00
Peter Alexander
b7472c4e39 Corrected constraints for std.algorithm.endsWith
Previously endsWith constraints only required input ranges, but the algorithm uses `back` and `popBack` within, so clearly a bidirectional range is needed.
2012-12-15 23:20:20 +00:00
Dmitry Olshansky
bde7cbad4d fix issue 9160 multiSort constraint bug 2012-12-15 18:07:57 +04:00
Andrei Alexandrescu
1b2b5fb76e Merge pull request #951 from monarchdodra/count3
improvements/fixes for count countUntil
2012-12-13 09:17:47 -08:00
monarch dodra
e8d320f82f imporvements to uninitializedFill && initializeAll
Because they didn't really handle all of the cases correctly.

Added unittests.
2012-12-13 17:34:57 +01:00
Andrei Alexandrescu
0fcca44b8d Merge pull request #787 from blackwhale/loan-stable-sort
fix stable sort (4584)
2012-12-12 07:38:10 -08:00
jmdavis
74f8c844fe Revert "Add alias opDollar and use $ in range slicing"
This reverts commit 07104b5fe6.

As we cannot currenly rely on even ranges with slicing implementing
opDollar, this change breaks code, because it assumes that such ranges
implement opDollar.
2012-12-09 17:21:37 -08:00
lomereiter
9f8669b567 changed return type of NWayUnion.front to auto ref 2012-12-09 22:12:53 +04:00
k-hara
07104b5fe6 Add alias opDollar and use $ in range slicing 2012-12-05 10:13:17 +09:00
k-hara
58a8ccf42e Fix for moveFront, moveBack, and moveAt
- I assume they are not properties, then changed to normal functions.
- Global .moveFront/Back uses front and back if member moveFront/back doesn't exist.
  Then, member aliases are just redundant.
2012-12-03 00:53:52 +09:00
jmdavis
20341b4980 Implement issue# 9103.
find should work with multiple needles which are a combination of
elements and ranges rather than just all ranges - just like startsWith
and endsWith do - and since that overload of find calls startsWith, it's
trivial to make it take the same types of arguments as startsWith.
2012-12-02 01:53:29 -08:00
k-hara
0c88021d4b Add more test case 2012-11-25 17:23:33 +09:00
k-hara
a404b3108f Change module level functions to nested class static member. 2012-11-25 15:52:42 +09:00
k-hara
cd432f7b2f Add forward template 2012-11-25 13:47:00 +09:00