aboutsummaryrefslogtreecommitdiff
path: root/src/script/script_error.cpp
diff options
context:
space:
mode:
authorAkio Nakamura <[email protected]>2017-12-22 19:04:30 +0900
committerEvan Klitzke <[email protected]>2018-02-27 11:42:33 -0800
commite46be25f0e19d574157752a5c0b674907a1578e6 (patch)
tree66d7155ce0b5ffa5e34fdd281dc9314667050307 /src/script/script_error.cpp
parentAdd new prevector benchmarks. (diff)
downloaddiscoin-e46be25f0e19d574157752a5c0b674907a1578e6.tar.xz
discoin-e46be25f0e19d574157752a5c0b674907a1578e6.zip
Reduce redundant code of prevector and speed it up
In prevector.h, the code which like item_ptr(size()) apears in the loop. Both item_ptr() and size() judge whether values are held directly or indirectly, but in most cases it is sufficient to make that judgement once outside the loop. This PR adds 2 private function fill() which has the loop to initialize by specified value (or iterator of the other prevector's element), but don't call item_ptr() in their loop. Other functions(assign(), constructor, operator=(), insert()) that has similar loop, call fill() instead of original loop. Also, resize() was changed like fill(), but it calls the default constructor for that element each time.
Diffstat (limited to 'src/script/script_error.cpp')
0 files changed, 0 insertions, 0 deletions