Skip to content

Conversation

jmdavis
Copy link
Member

@jmdavis jmdavis commented Feb 23, 2011

Here are some improvements to RedBlackTree as discussed in the newsgroup. It should improve the remove situation and deals with most everything listed in http://d.puremagic.com/issues/show_bug.cgi?id=5451 . I also made it a class, since we're planning to change all of the containers to std.container, and making it a class fixes the default construction problem that it had.

Steven should probably have a look at this before it gets merged in, though I have no idea when he'll get around to that, since he hasn't gotten around to figuring out git yet. So, if multiple other folks look at it and think that it's good though, then we should probably just merge it in and let Steven worry about making whatever changes he thinks are appropriate later. Certainly, these changes make RedBlackTree more usable.

1. It's now a class. The only constructor is now the default
constructor (since templatizing the constructors does not appear to
currently work).

2. It now has a helper function - redBlackTree - for creating it.

3. It now has a length property.

4. It now has a version of remove which takes a Take!Range.

5. It now has removeKey to allow you to remove one or more elements by value from it.
@schveiguy
Copy link
Member

Probably can remove the comment about Bug 2810, I think that was just fixed. However, I haven't tested yet...

@schveiguy
Copy link
Member

It is probably not necessary to add length checks to so many unit tests.

@schveiguy
Copy link
Member

BTW, I like the scope(success) usage to alter length, I'm going to steal that idea for dcollections too ;)

@jmdavis
Copy link
Member Author

jmdavis commented Feb 24, 2011

@schveiguy I could probably remove length from some of the unit tests, but given all of the various places that length has to be changed, it seemed a lot safer to just be thorough about it.

@schveiguy
Copy link
Member

Overall: looks good, need to fix that remove+Take function (see comment about what should be returned when removing an empty range).

…-Programming-Language/Phobos.

I think that I took all of the suggestions into account, so it should be
improved per those suggestions. I also beefed up the unit tests a bit in
order to take different less and allowDuplicate values into account
(previously, it was only testing the defaults for those template
parameters).
@jmdavis
Copy link
Member Author

jmdavis commented Feb 24, 2011

I've made the changes as suggested and improved the unit tests a bit.

@andralex
Copy link
Member

I tried to merge this, by following the instructions. However, unittests fail:

std/datetime.d(28538): Error: undefined identifier tzname, did you mean function name?

What's going on?

@jmdavis
Copy link
Member Author

jmdavis commented Feb 27, 2011

Update druntime. The declaration of tzname got moved to drutime where it belongs.

@andralex
Copy link
Member

Done.

kyllingstad pushed a commit to kyllingstad/phobos that referenced this pull request Apr 26, 2011
…-Programming-Language/Phobos.

I think that I took all of the suggestions into account, so it should be
improved per those suggestions. I also beefed up the unit tests a bit in
order to take different less and allowDuplicate values into account
(previously, it was only testing the defaults for those template
parameters).
burner added a commit to burner/phobos that referenced this pull request Jul 14, 2014
burner added a commit to burner/phobos that referenced this pull request Jul 15, 2014
burner added a commit to burner/phobos that referenced this pull request Jul 16, 2014
burner added a commit to burner/phobos that referenced this pull request Jul 24, 2014
burner added a commit to burner/phobos that referenced this pull request Aug 8, 2014
burner added a commit to burner/phobos that referenced this pull request Aug 18, 2014
burner added a commit to burner/phobos that referenced this pull request Aug 19, 2014
burner added a commit to burner/phobos that referenced this pull request Aug 26, 2014
burner added a commit to burner/phobos that referenced this pull request Sep 8, 2014
burner added a commit to burner/phobos that referenced this pull request Sep 15, 2014
burner added a commit to burner/phobos that referenced this pull request Sep 15, 2014
burner added a commit to burner/phobos that referenced this pull request Sep 25, 2014
burner added a commit to burner/phobos that referenced this pull request Oct 2, 2014
burner added a commit to burner/phobos that referenced this pull request Oct 3, 2014
burner added a commit to burner/phobos that referenced this pull request Oct 10, 2014
burner added a commit to burner/phobos that referenced this pull request Oct 11, 2014
burner added a commit to burner/phobos that referenced this pull request Oct 11, 2014
burner added a commit to burner/phobos that referenced this pull request Nov 9, 2014
burner added a commit to burner/phobos that referenced this pull request Nov 12, 2014
burner added a commit to burner/phobos that referenced this pull request Nov 19, 2014
burner added a commit to burner/phobos that referenced this pull request Nov 25, 2014
burner added a commit to burner/phobos that referenced this pull request Dec 10, 2014
burner added a commit to burner/phobos that referenced this pull request Dec 25, 2014
burner added a commit to burner/phobos that referenced this pull request Dec 26, 2014
burner added a commit to burner/phobos that referenced this pull request Jan 3, 2015
burner added a commit to burner/phobos that referenced this pull request Jan 3, 2015
burner added a commit to burner/phobos that referenced this pull request Jan 18, 2015
burner added a commit to burner/phobos that referenced this pull request Jan 22, 2015
burner added a commit to burner/phobos that referenced this pull request Jan 25, 2015
burner added a commit to burner/phobos that referenced this pull request Jan 25, 2015
some more docu fixes

fatel -> fatal

changed the way of calling

some rework

some better comments and win32.mak fix

more documentation

trying to figure out why win32 fails

test before you commit

another try to work around windows files and processes

maybe this time

maybe this merges

update 1 mostly soenke

MultiLogger and Logger have names

more docu

unittest fix

some better comments and win32.mak fix

Conflicts:
	std/logger.d

antoher doc fix

less code dup and more log functions

docs are now generated

some more fixing

speedup

some threading

forgot some

better docu gen and more testing

two new LogLevel, most functions are now at least @trusted

Tracer functionality

fatal delegate

some phobos style fixes

another bug bites the dust

version disable enhancements

default global LogLevel set to LogLevel.all

logLevel compare bugfix

delete of dead code

tab to whitespace

bugfixes, reduandency removal, and docu

multilogger was logging to all it childs without checking there LogLevel in
relation to the LogLevel of the LoggerPayload.

Some constructors where redundant.

more examples and more documentation

some fixes

NullLogger and moduleName

wrong doc

I splitted the multi logger implementations out

loglevelF to loglevelf in order to make phobos style think writefln

document building

win makefile fixes

some optimizations thanks to @elendel-
some whitespace

some updates from the github logger project

* stdio- and filelogger now use a templatelogger base to reduce code

makefile fixes

makefile

fixed the unittest

made sure the stdiologger is set up at the end

some comment fixes

finding the filelogger segfault

closed another file

a lookup fix

darwin unittest fail output

more diagnostics

* more documentation for the templatelogger and multilogger
* it breaks the log function api
 * log and logf now behave as their write and writef counterparts
 * for logging with an explicit LogLevel call logl loglf
 * for logging with an explicit condition call logc logcf
 * for logging with an explicit LogLevel and explicit condition call
 * loglc loglcf
 * the log function with an explicit LogLevel like info, warning, ...
 * can be extended into c, f or cf and therefore require a condition
 * and/or are printf functions

something is still interesting

rebase and lazy Args

saver file handling

whitespace

some updates

tracer is gone and more doc updates

codegen rework to allow log function comments

thread safe and concur works comments for free standing log functions

fixes dlang#10

* free log function doco
* StdIOLogger prints now threadsafe
* concurrentcy hang fix

more docu

old file

even more doc

typo

* more better doc
* makefile fix

another fix

more unittests nearl 100% everywhere

another test

no more mixins more doc

win64 please pass

fixes from the review and voting

hope this fixes it

more comments

more docs more tests

more docu

more doc and fixes from jacob-carlborg

LogEntry.logger reference

more fixes

fileptr is gone

logger move to experimental/logger

type in win32/64 makefile

win makefile

nogc and threading

makefile fixes

some log calls take line and file as parameter
andralex referenced this pull request in andralex/phobos Feb 1, 2015
some more docu fixes

fatel -> fatal

changed the way of calling

some rework

some better comments and win32.mak fix

more documentation

trying to figure out why win32 fails

test before you commit

another try to work around windows files and processes

maybe this time

maybe this merges

update 1 mostly soenke

MultiLogger and Logger have names

more docu

unittest fix

some better comments and win32.mak fix

Conflicts:
	std/logger.d

antoher doc fix

less code dup and more log functions

docs are now generated

some more fixing

speedup

some threading

forgot some

better docu gen and more testing

two new LogLevel, most functions are now at least @trusted

Tracer functionality

fatal delegate

some phobos style fixes

another bug bites the dust

version disable enhancements

default global LogLevel set to LogLevel.all

logLevel compare bugfix

delete of dead code

tab to whitespace

bugfixes, reduandency removal, and docu

multilogger was logging to all it childs without checking there LogLevel in
relation to the LogLevel of the LoggerPayload.

Some constructors where redundant.

more examples and more documentation

some fixes

NullLogger and moduleName

wrong doc

I splitted the multi logger implementations out

loglevelF to loglevelf in order to make phobos style think writefln

document building

win makefile fixes

some optimizations thanks to @elendel-
some whitespace

some updates from the github logger project

* stdio- and filelogger now use a templatelogger base to reduce code

makefile fixes

makefile

fixed the unittest

made sure the stdiologger is set up at the end

some comment fixes

finding the filelogger segfault

closed another file

a lookup fix

darwin unittest fail output

more diagnostics

* more documentation for the templatelogger and multilogger
* it breaks the log function api
 * log and logf now behave as their write and writef counterparts
 * for logging with an explicit LogLevel call logl loglf
 * for logging with an explicit condition call logc logcf
 * for logging with an explicit LogLevel and explicit condition call
 * loglc loglcf
 * the log function with an explicit LogLevel like info, warning, ...
 * can be extended into c, f or cf and therefore require a condition
 * and/or are printf functions

something is still interesting

rebase and lazy Args

saver file handling

whitespace

some updates

tracer is gone and more doc updates

codegen rework to allow log function comments

thread safe and concur works comments for free standing log functions

fixes #10

* free log function doco
* StdIOLogger prints now threadsafe
* concurrentcy hang fix

more docu

old file

even more doc

typo

* more better doc
* makefile fix

another fix

more unittests nearl 100% everywhere

another test

no more mixins more doc

win64 please pass

fixes from the review and voting

hope this fixes it

more comments

more docs more tests

more docu

more doc and fixes from jacob-carlborg

LogEntry.logger reference

more fixes

fileptr is gone

logger move to experimental/logger

type in win32/64 makefile

win makefile

nogc and threading

makefile fixes

some log calls take line and file as parameter
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants