| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
* 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
* move since import in system below for HCR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
* 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
* use 'when nimVM'
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* better docs: lists
* better docs: deques
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|