Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tpapp/PushVectors.jl
workaround for julia#24909
https://github.com/tpapp/PushVectors.jl
Last synced: 14 days ago
JSON representation
workaround for julia#24909
- Host: GitHub
- URL: https://github.com/tpapp/PushVectors.jl
- Owner: tpapp
- License: other
- Created: 2019-04-29T10:19:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-20T09:18:05.000Z (almost 4 years ago)
- Last Synced: 2024-10-11T22:01:26.955Z (about 1 month ago)
- Language: Julia
- Size: 17.6 KB
- Stars: 9
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PushVectors
![Lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)
[![Build Status](https://travis-ci.com/tpapp/PushVectors.jl.svg?branch=master)](https://travis-ci.com/tpapp/PushVectors.jl)
[![codecov.io](http://codecov.io/github/tpapp/PushVectors.jl/coverage.svg?branch=master)](http://codecov.io/github/tpapp/PushVectors.jl?branch=master)Implement a workaround for [julia#24909](https://github.com/JuliaLang/julia/issues/24909), using a [suggestion](https://github.com/JuliaLang/julia/issues/24909#issuecomment-419731925) by @KristofferC (code used with permission, modified by @tpapp, who is responsible for all bugs etc).
## Should I use this package?
Probably not, unless `push!` to `Vector` is **the** bottleneck in your code.
This is just a demonstration, and will be deprecated when the issue above is fixed.
## Overview
The single exported type is `PushVector`, which can be `push!`ed to. Use `finish!` to shrink and obtain the final vector, but note that you should not use the original after that.
```julia
julia> v = PushVector{Int}()
0-element PushVector{Int64,Array{Int64,1}}julia> push!(v, 1)
1-element PushVector{Int64,Array{Int64,1}}:
1julia> finish!(v)
1-element Array{Int64,1}:
1
```