aboutsummaryrefslogtreecommitdiff
path: root/src/script/script.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2017-06-13 18:28:24 +0200
committerWladimir J. van der Laan <[email protected]>2017-06-13 18:32:44 +0200
commita514ac3dcb6058f7567025e95805a4592323da82 (patch)
treeef759ee785a11f74d24ef6559bb93e04d1988ef3 /src/script/script.h
parentMerge #10553: Simplify "bool x = y ? true : false". Remove unused function an... (diff)
parentClarify prevector::erase and avoid swap-to-clear (diff)
downloaddiscoin-a514ac3dcb6058f7567025e95805a4592323da82.tar.xz
discoin-a514ac3dcb6058f7567025e95805a4592323da82.zip
Merge #10534: Clarify prevector::erase and avoid swap-to-clear
e241a63 Clarify prevector::erase and avoid swap-to-clear (Pieter Wuille) Tree-SHA512: fa7602038feb4417158df13ee7c0351673acf38f8a824e75889710344c46a9b8d5f6059faeb521f73e48b7ad3e1a238a9e433e4b44f7c3b9085ff08ef65271fa
Diffstat (limited to 'src/script/script.h')
-rw-r--r--src/script/script.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/script/script.h b/src/script/script.h
index 23706b982..bbb37f049 100644
--- a/src/script/script.h
+++ b/src/script/script.h
@@ -648,8 +648,9 @@ public:
void clear()
{
- // The default std::vector::clear() does not release memory.
- CScriptBase().swap(*this);
+ // The default prevector::clear() does not release memory
+ CScriptBase::clear();
+ shrink_to_fit();
}
};