forked from OSchip/llvm-project
[Support][JSON] Add reserve() to json Array
Summary: Space reservation increases json lib performance for the arrays with large number of entries. Here is the example and discussion: https://reviews.llvm.org/D60609#1468941 Reviewers: lebedev.ri, sammccall Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60788 llvm-svn: 358520
This commit is contained in:
parent
82ffa88a04
commit
765f018381
|
@ -179,6 +179,7 @@ public:
|
|||
|
||||
bool empty() const { return V.empty(); }
|
||||
size_t size() const { return V.size(); }
|
||||
void reserve(size_t S) { V.reserve(S); }
|
||||
|
||||
void clear() { V.clear(); }
|
||||
void push_back(const Value &E) { V.push_back(E); }
|
||||
|
|
Loading…
Reference in New Issue