Commit graph

518 commits

Author SHA1 Message Date
simendsjo
db8a7b4e51 Bug 2128 has been resolved 2011-11-06 16:53:23 +01:00
Nils Boßung
4110f56ac6 (bugzilla 6874) disable the broken optimized path and fall back to appender
Also add a unittest.
This doesn't properly resolve the issue, of course.
2011-11-03 22:49:27 +01:00
jmdavis
256976dddd Removed "scheduled for deprecation" pragmas.
The pragmas have not been as effective as we might have liked, since
they only work with templates and can't tell you where in your code you
need to make changes, and they seemed to have been more annoying to
programmers than helpful, so we're going to discontinue them. We'll
leave them in for stuff that's actually been deprecated until deprecated
has been improved enough to take a message, but we'll leave "scheduled
for deprecation" messages to the documentation and changelog.
2011-10-23 23:11:17 -07:00
k-hara
fef20ede25 Revert "Merge pull request #284 from 9rnsr/fix6208_on_inout"
This change will be required after finxing bug6208.

This reverts commit e669812d26, reversing
changes made to 5ffd5b34e8.
2011-10-13 12:44:45 +09:00
k-hara
42324e028b fix6208 on inout 2011-10-02 22:08:46 +09:00
Andrei Alexandrescu
ed5b2878dc Merge pull request #168 from klickverbot/array-replace
std.array.replaceFirst() bug and doc fixes
2011-08-03 10:21:16 -07:00
David Nadlinger
a742851d2a Cover the case with no whitespace at the end in split() tests. 2011-08-02 22:18:42 +02:00
David Nadlinger
22f4e83821 Added basic Appender capacity/shrinkTo tests. 2011-08-02 22:18:42 +02:00
David Nadlinger
32aada659d Added test for the one-element branch of Appender.put(). 2011-08-02 22:18:42 +02:00
David Nadlinger
27ed4eb62e Added unit test for the overlapping replaceInPlace() branch. 2011-08-02 22:18:41 +02:00
David Nadlinger
7c9fb77850 Added tests for the (isForwardRange!RoR && hasLength!RoR && hasLength!(ElementType!RoR) && hasLength!R) join(RoR, R) and (isForwardRange!RoR && hasLength!RoR && hasLength!(ElementType!RoR)) join(RoR) branches. 2011-08-02 22:18:41 +02:00
David Nadlinger
8af69b0cff Fixed std.array.replaceFirst unit tests.
The unittest block seemed to be a direct copy of the replace() one, now it actually tests replaceFirst().
2011-08-02 18:03:25 +02:00
David Nadlinger
7a73b40e71 std.array.replaceFirst omitted the part after the match from the result. 2011-08-02 17:59:08 +02:00
David Nadlinger
2d472caa80 replace() and replaceFirst() don't return a copy of the array if nothing changed.
This behavior is reasonable and explicitly tested for in the unit tests, but previously, one could think that they always returned a copy from the docs.
2011-08-02 17:56:25 +02:00
KennyTM~
32d24ea24d std.file.read: Create the uinitialized arrays using ubyte[] to ensure NO_SCAN after commit 78ace9c 2011-07-17 15:41:14 +08:00
KennyTM~
58d638f14b Merge branch 'master' into uninitializedArray 2011-07-17 14:18:04 +08:00
David Simcha
55fc7a2154 Merge pull request #146 from jmdavis/join
Issue 6064: std.array.join is unnecessarily slow for strings
2011-07-16 15:47:33 -07:00
David Simcha
bded0b2359 Merge pull request #143 from jmdavis/array
Made std.array.replace work with immutable arrays again.
2011-07-16 15:41:11 -07:00
dsimcha
78ace9ce8b Fix unlisted bug in blockAttribute: uninitializedArray allocates unscanned arrays when allocating a void[]. 2011-07-16 18:31:54 -04:00
jmdavis
ed6ede2e1c Split out std.array.join into join and joinImpl.
The idea is to make the template constraint match exactly what the user
needs to instantiate it rather than seeing the more complex template
constraints that the various overloads of join have. Not that the
resulting template constraint is altogether short either, but it's now
the bare minimum which all join overloads must match rather than
including the specifics necessary to distinguish each overload.
2011-07-16 00:31:53 -07:00
jmdavis
fc51d8654e Optimized std.array.join for arrays.
http://d.puremagic.com/issues/show_bug.cgi?id=6064
2011-07-16 00:31:46 -07:00
KennyTM~
df4e92d712 (Minor cleanup) Change some idiomic GC.malloc usage to uninitializedArray
Simplify the common pattern `(cast(T*)GC.malloc(T.sizeof * n, NO_SCAN))[0 .. n]` to the new function `uninitializedArray!(T[])(n)`.

Note that there was some `NO_SCAN` attributes originally determined at runtime using `typeid()`, but now is determined statically using `hasIndirection!()` from the implementation of `uninitializedArray`.
There were also some `GC.malloc` usage looks like `uninitializedArray` in `std.parallelism` but I'm leaving it alone for someone who is more familiar with this module ;).
2011-07-14 04:29:34 +08:00
jmdavis
c9dcd79bfe Made std.array.replace work with immutable arrays again.
I also went over the other functions in std.array and made them work
with immutable arrays where applicable. The unit tests have been
appropriately expanded as well.
2011-07-12 23:07:16 -07:00
Jonathan M Davis
da0fd9dbf8 Merge pull request #101 from jmdavis/string
Improvements for std.string, std.uni, and std.ctype.
2011-07-03 00:12:57 -07:00
Don Clugston
337a6182d3 CTFE support for Appender
Makes a large chunk of Phobos usable in CTFE. Fixes:
5632 replace() not evaluatable at compile-time anymore

This is still not very efficient, for CTFE it's a bit more efficient to just
use ~= for appending.
2011-06-30 03:12:25 +02:00
jmdavis
7de549c1fa Merged master into branch with changes to std.string.
Conflicts:
	changelog.dd
	std/array.d
2011-06-22 21:38:17 -07:00
jmdavis
e3f7c0c288 Renamed isUniWhite to isWhite. 2011-06-22 19:44:36 -07:00
Steven Schveighoffer
91ef3b4350 Split lines that were too long 2011-06-22 09:13:55 -04:00
Steven Schveighoffer
6452327a1b Fixed issue 6193: Appender.clear() functionality or documentation 2011-06-22 09:09:52 -04:00
jmdavis
fde6d40447 Merge in pull request #92 of D-Programming-Language / phobos.
Conflicts:
	std/array.d
2011-06-21 21:22:04 -07:00
Andrei Alexandrescu
0b26f67636 Merge pull request #96 from dsimcha/master
uninitializedArray
2011-06-21 21:01:45 -07:00
Dmitry Olshansky
8c29e10ced Clean up code and revert description for insertInPlace 2011-06-19 22:29:10 +04:00
dsimcha
8aac844b81 Add minimallyInitializedArray 2011-06-16 20:28:42 -04:00
Dmitry Olshansky
6c7b9a0697 Another attempt to generalize insertInPlace. 2011-06-15 02:04:08 +04:00
jmdavis
dd3a0c20a2 Created std.ascii to replace std.ctype.
All of the new, properly camelcased functions in std.ctype have been
moved to std.ascii, and std.ctype has been scheduled for deprecation.
2011-06-14 04:06:54 -07:00
jmdavis
d0d0f72eb1 Improvement to popBack's template constraint. 2011-06-12 22:06:26 -07:00
jmdavis
76e1cfd2e9 Replaced calls to std.ctype.isspace with std.ctype.isWhite.
In a few places, I replaced it with std.uni.isUniWhite, but for the most
part, I replaced it with std.ctype.isWhite.
2011-06-12 16:59:50 -07:00
jmdavis
0e1afe82cb Improved std.string.indexOf and std.string.lastIndexOf.
indexOf and lastIndexOf should not work properly with unicode for all
string types (unlike before). As part of that, I also ended up fixing a
bug in std.array.back for strings (wstrings in particular were broken).
I also improved various, related unit tests.
2011-06-12 16:59:50 -07:00
jmdavis
b67fd548b5 Adjusted deprecation messages for stuff which was previously scheduled for deprecation. 2011-06-12 16:59:49 -07:00
Dmitry Olshansky
2ef493e6c3 Variadic insertInPlace for strings & chars. 2011-06-13 03:36:58 +04:00
jmdavis
e6ca8c8852 Removed unused imports of std.encoding. 2011-06-12 03:54:33 -07:00
dsimcha
fb8d8b6c63 Add uninitializedArray to std.array. 2011-06-11 11:50:33 -04:00
Dmitry Olshansky
9e43abfa09 Make insertInPlace more versatile 2011-06-10 13:47:36 +04:00
k-hara
4c7f99bd06 Issue 5663 - std.array.Appender.put bug
http://d.puremagic.com/issues/show_bug.cgi?id=5663

Do not treat an Appender of const/immutable string as a range.
2011-05-28 12:44:06 +09:00
Andrei Alexandrescu
d061f13d34 https://github.com/D-Programming-Language/phobos/pull/23 2011-05-01 12:11:46 -05:00
jmdavis
7d98998c57 Merged in Pull Request #14 for D-Programming-Language / phobos. 2011-04-16 00:31:30 -07:00
Andrei Alexandrescu
055cea0595 Merge branch 'master' of github.com:D-Programming-Language/phobos
Conflicts:
	posix.mak
2011-04-06 00:32:29 -05:00
jmdavis
b04b99629f Changes to std.array per suggestions on pull request #14 of D-Programming-Language / phobos. 2011-02-27 17:02:05 -08:00
Andrei Alexandrescu
1083bd4e7b One pass through std.range and friends
* Made emplace faster and replaced calls to it to also make them faster.

* Replaced phobos.d in posix.mak with index.d.

* Added version=StdDdoc to documentation build in posix.mak, and replaced uses of D_Ddoc with it.

* Improved documentation target in posix.mak (target dir automatically created).

* Added nice documentation table and cheat sheet at the top of std.algorithm.

* Replaced a few helper structs in std.range and std.algorithm with local structs, which simplify matters a fair amount.

* Added more constraints to functions in std.algorithm (still work in progress).

* Improved error message in std.algorithm.sort in case of failure to sort.

* std.random.dice(1, 10) now works (no need for array notation std.random.dice([1, 10])).

* Fixed documentation bugs and insufficiencies in std.range (still more to do).

* Improved speed of walkLength.

* Simplified retro.

* Simplified and optimized stride. Also folded stride(stride(r, a), b) into stride(r, a * b).

* Added roundRobin to std.range, which as a perk simplified radial.

* Added takeOne and takeNone to std.range.

* Added unsigned to std.traits.
2011-02-27 12:38:49 -06:00
jmdavis
a7a39f2003 Some improvements to std.array.
In particular, functions which make changes in place have now been
renamed to have InPlace in their name as discussed on the newsgroup
(with versions with the old names scheduled for deprecation). I also
created versions for those functions which do _not_ do the changes in
place, but in at least a couple of cases, they had to be left commented
out until the old versions which do make the changes in place have
actually been removed. I'd love to just remove the old versions, but
that would silently break code, so tough luck for now.
2011-02-27 04:36:47 -08:00