Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

No way to manipulate Array or Array elements #21

Open
luke-jr opened this issue Feb 14, 2016 · 1 comment
Open

No way to manipulate Array or Array elements #21

luke-jr opened this issue Feb 14, 2016 · 1 comment
Assignees
Milestone

Comments

@luke-jr
Copy link

luke-jr commented Feb 14, 2016

operator[] returns a const, preventing modifications. Similarly, there is no way to replace items in an Array.

@jgarzik
Copy link
Owner

jgarzik commented May 3, 2017

2017_modify branch adds erase() support https://github.com/jgarzik/univalue/tree/2017_modify Needs improvement, comments welcome etc.

insert()-at-position should probably also be added. The combination of the two would permit replacing items (and perhaps a two-line inline replace() helper method).

@jgarzik jgarzik self-assigned this Feb 3, 2019
@jgarzik jgarzik added this to the 2.0.0 milestone Feb 3, 2019
martinus pushed a commit to martinus/univalue that referenced this issue Feb 13, 2021
b4cdfc4 Remove hand-coded UniValue destructor. (Martin Ankerl)

Pull request description:

  When the hand-written destructor is removed, the compiler will automatically create a proper one, with correct `noexcept`. This allows `std::vector<UniValue>` to be resized without having to copy all elements first, which makes JSON generation of a bitcoin block (as in the benchmark "BlockToJsonVerbose") 25% faster on my machine.

Top commit has no ACKs.

Tree-SHA512: a4a5a352d946e795b7d78b98b781969caa103acb19770d22d62efd16f42b2845c476dee57df729e983018e065e3b450f3f1e3c95cf68b2f359ee4ca24fba217f
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants