Commit Graph
7 Commits
Author SHA1 Message Date
adamnemecek 81d9da57d8 Refactor PriorityQueue ==. (#183)
Motivation:

The new implementation doesn't convert lhs and rhs to arrays, thereby saving 2 allocations.

Modifications:

Changed the body of priority queue ==.

Result:

The comparison will be faster and use less memory.
2018-03-17 01:56:15 +09:00
Ben Cohen 2c1d993978 Rename PriorityQueue's T to Element and iterator to Iterator, avoiding need for typealiases. (#91)
Motivation:

We've found following these conventions in the standard library simplifies
the code significantly if you create a lot of generic types that conform
to the std lib protocols.

Modifications:

Change the placeholder T to Element and remove now-unnecessary typealias.
Switch the name of the iterator to just Iterator, and have it re-use
the outer type's Element placeholder. Remove now-unnecessary typealiases.
Add deprecated typealiases to make this a non-breaking change.

Result:

Should be a non-functional change. Explicit typing outside the PriorityQueue
type would need to change, but there wasn't any.
2018-03-04 08:36:15 -08:00
adamnemecek 0bbed6d72f * removed trailing whitespace (#52) 2018-03-02 15:40:52 +09:00
Johannes Weiß 73a805c7f6 minor stylistic improvements (#36)
Motivation:

Sometimes we deviated from the style the Swift stdlib sets out for no
reason.

Modifications:

Fixed some stylistic deviations.

Result:

Looks more Swift-like.
2018-02-26 15:52:49 +00:00
Johannes Weiß 25f4e2ceff PriorityQueue: make it work for partial orders 2017-12-12 11:13:33 +00:00
Johannes Weiss 40454741d1 more interesting PriorityQueue test 2017-12-11 14:34:49 +00:00
Johannes Weiss 8335b6c3a0 replace priority queue 2017-11-28 16:13:26 +00:00