summary refs log tree commit diff stats
path: root/lib/pure/collections/deques.nim
Commit message (Collapse)AuthorAgeFilesLines
* docs minor (#15550)flywind2020-10-111-2/+2
|
* deques.nim: Refactor the `toDeque` functionality (#15166)ee72020-08-071-5/+18
| | | | | | | | | | | | | | | | | | | | This commit polishes the new proc introduced by d9ed816b10a6. Changes: - Rename to `toDeque` for more consistency with well-known procs like `toHashSet` and `toTable`. - Rename the `openArray` parameter. The name `arr` was potentially less clear given that the proc can be used with a seq (or string). - Add a `since` annotation. - Reword the doc comment, and clarify that ordering is preserved. - Add runnableExamples. - Add "see also" cross linking between `initDeque` and `toDeque`. - Remove duplicate `nextPowerOfTwo`. The `initImpl` template already includes it. - Implement the proc using the `items` iterator, rather than indexing. This matches the implementation of `sets.toHashSet` and `tables.toTable`. - Add a test within `when isMainModule`. - Add a changelog entry.
* Added the ability to initialize a deque with an openArray (#15138)archnim2020-08-051-0/+6
| | | | | | | | | | | | * Add ability to initialize a deque with a sequence Example: var dq = initDeque[char](@['a', 'b', 'c']) * Update deques.nim * Optimized deque initialization * Sequence replaced by open array in deque initialization
* remove a condition that table size must be passed as power of 2 (#14926)Miran2020-07-081-8/+3
| | | | | | | | | | | | | | | * remove a condition that table size must be passed as power of 2 * remove power-of-2 condition from sets and sharedtables * remove power-of-2 condition from deques * use 'correctSize' for both branches * prettify changelog.md and fix typos * add a changelog entry * fix double-call of 'right-size' * fix the same thing in sets.nim * introduce a new internal proc `slotsNeeded` Deprecate the public proc `rightSize`, which is not needed anymore. Now it is an identity function, allowing the old code to work correctly and without extra allocations.
* move since from inclrtl to std/private/since (#14188)hlaaftana2020-05-021-1/+1
| | | | * move since from inclrtl to std/private/since * move since import in system below for HCR
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-12/+12
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* Add deques.peekFirst/Last(var Deque[T]) -> var T (#13542)hlaaftana2020-04-211-0/+41
| | | | | | | * Add deques.peekFirst/Last(var Deque[T]) -> var T * Add changelog entry for deques.peekFirst/Last var T overloads * Add since annotation to peekFirst/peekLast Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fix #13310, Deque misbehaves on VM (#13625)Miran2020-03-111-2/+15
| | | | * fix #13310, Deque misbehaves on VM * use 'when nimVM'
* Auto-initialize deques (#12879)Ico Doornekamp2019-12-211-3/+17
|
* remove unused import (#12900)Krzysztof Majk2019-12-151-1/+1
|
* use system.move instead of system.shallowCopy if the GC mode requires itAndreas Rumpf2019-10-041-3/+5
|
* [other] prettify collections (#11695)Miran2019-07-091-13/+13
|
* better docs for lists and deques (#10390)Miran2019-01-211-33/+265
| | | | | | * better docs: lists * better docs: deques
* Implements BackwardsIndex `[]` for deque. (#10105)Dominik Picheta2019-01-131-1/+13
|
* make tests green againAraq2018-08-211-4/+1
|
* stdlib workZahary Karadjov2018-06-161-6/+51
|
* Improved collection-to-string behavior (#6825)Fabian Keller2017-12-141-1/+1
|
* make tests green againAndreas Rumpf2017-10-291-2/+2
|
* Fixes #6110Daniil Yarancev2017-08-121-1/+1
|
* Deques compilation error fix (#5591)Dmitriy Fomichev2017-03-241-2/+2
|
* Various fixes to FutureStreams based on PR feedback.Dominik Picheta2017-02-261-1/+1
|
* More workarounds for #5098Yuriy Glukhov2016-12-071-1/+4
|
* Added deques module, deprecating queuesRuslan Mustakov2016-11-241-0/+266